cat pipe. Was: Sony audio (MSV), and LAME is lame
Ben Scott
dragonhawk at gmail.com
Thu Oct 4 15:08:43 EDT 2007
On 10/4/07, Bill McGonigle <bill at bfccomputing.com> wrote:
> sudo cat /var/log/maillog | grep -i syslang
>
> so it's an easy habit to get into. There's no reason to run grep as
> root in that example. grep might be [read: is] buggy.
Well, cat(1) *is* a GNU program, after all. It probably has a
couple buffer overflows in it, too. ;-)
> It's also conceptually very straightforward.
So is
< infile foo | bar | baz > outfile
... don't you think?
> And if you wrote the thing in assembly instead of a shell script it'd
> be even more efficient!
No. Efficiency is about ROI, not about absolutes. Writing it in
assembly would take longer. On the other hand, it actually takes more
keystrokes to do this:
cat infile | foo | bar | baz > outfile
than it is to do this:
< infile foo | bar | baz > outfile
I mean, my gosh, with cat, you're using *twice* as many keystrokes
as you need to! ;-)
Of course, it's a fair bet that more effort has been spent arguing
about UUOC than would ever be saved by eliminating UUOC. But hey.
"Repetition is the very soul of the 'net." ;-)
-- Ben
More information about the gnhlug-discuss
mailing list