> Graeme Tait wrote:
> > Certainly "cat filename | more" is redundant: "more filename" is sufficient.
> > --
> > Graeme Tait - Echidna
> Well, you should have seen
> And has K. Marsh said, how could I introduce pipe so simply without the
> cat exemple :-)
(Please note, I'm not complaining about your user guide - I think it's great!
However, the cat example struck a nerve!)
There's no need to use cat in a case like that above. I think its best not to
give newbies examples they have to unlearn - I've already been down this path
with cat, having found a similar example in a standard UNIX text. As a beginner,
you get into questions like "well it looks like I could just do 'more filename'
but the book says 'cat filename | more' so I guess there must be a good reason
for that, so I'll follow the book ... but ???".
I would choose a simple case where the pipe is clearly necessary.
> ls -l | more
to page a file listing of a directory with many files, say /usr/bin . This lets
you introduce the pipe and the paging program.
The example you give uses cat to transfer the contents of a file to stdout, and
pipes that to stdin. AFAIK, since most commands (that can accept input from
stdin) can accept input from a single file directly, this application of cat has
very limited utility. The true uses I've found for cat are (1) creating short
text files directly, as in
> cat > file[input
and (2) concatenating files, as in
> cat file1 file2 > bothfiles
Graeme Tait - Echidna
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-newbies" in the body of the message