Thomas Adam wrote:

--- Pete Clarke <[EMAIL PROTECTED]> wrote:



Why not pipe the output through less .. eg:
#> cat somedoc.txt | less



Why would you want to cat the file _and_ page it? That is a useless use of cat here, as less accepts STDIN.



1. Because it's a useful working example, unlike many others
2. I actually do just that sometimes. eg I cat a file and discover it's too long, so I back up and pipe it into less (or grep or awk or tail or head or head and tail).


Sometimes "cat  file|" is clearer than " <some very long command> <file"

eg
cat /etc/passwd | awk "/$USER/ {print \$0}"

Of course, the awk program could be quite a deal more complicate than that.

--

Cheers
John

-- spambait
[EMAIL PROTECTED]  [EMAIL PROTECTED]
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Reply via email to