filters

Charles Bryant ch at dce.ie
Fri Dec 7 21:32:09 AEST 1990


In article <1990Dec5.014313.28592 at ibmpcug.co.uk> dylan at ibmpcug.CO.UK (Matthew Farwell) writes:
>In article <1990Dec4.105612.14422 at dce.ie> ch at dce.ie (Charles Bryant) writes:
>>Many cat programs have several options, none of which can really be justified:
>>
>>	-u (unbuffered). My cat is always unbuffered. dd(1) is for buffering
>
>Sorry, but I find typing 'cat foobar' quite a bit easier than typing
>'dd if=foobar of=/dev/tty bs=512'. Strange, I know, but its this little
>idiosyncracy of mine.

Firstly, if foobar is a regular file there is no difference, and also
on my system 'dd if=foobar of=/dev/tty bs=512' can be abbreviated to
'dd <foobar'. Of course dd has an annoying 'feature' of printing the number
of blocks processed, but I have written a replacement dd to fix this as
well as the lack of an option to pad output to a multiple of the block
size (as is required with some tape drives). (I can give anyone a copy
of this who wants it).

>>	-s (silent).	Just use "cat 2>/dev/null".
>
>Assuming, of course that you're in a shell of some sort.

How else would it be invoked? The only other way I can think of is via
exec() when it is trivial to either close(2) or (better) redirect it
to /dev/null.
-- 
Charles Bryant (ch at dce.ie)
--
/usr/ch/.signature: Block device required



More information about the Comp.unix.programmer mailing list