[H-GEN] ASCII Characters
Paul Gearon
pag at pisoftware.com
Sun Oct 26 23:22:03 EST 2003
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
Trent WADDINGTON wrote:
> On Mon, 27 Oct 2003, James McPherson - PTS Engineer wrote:
>>Sure, but you missed the point. Tao was referring to a previous
>>post which had
>>
>>cat file | strings
>
> Which is the correct way.
Seems like a gratuitous use of "cat" to me.
What's wrong with:
strings < file
???
Why is is necessary to run a whole other process to get the shell to put
the contents of a file on stdin when the shell has this feature built in?
>>rather than just
>>
>>strings file
>
>
> Which is an unnecessary feature of strings.
I agree here.
> Grep was the next to fall. Why in the
> world does grep take filenames? Well, the dark side is seductive. If
> grep knows what files it is looking for patterns in it can print the name
> of the file before matches. This can be quite useful. It's even possible
> to grep -l, which does nothing but print the name of the file in which the
> match is found.
Not sure if I'd say that "Grep was the next to fall", though I see your
point. IMNSHO, finding a line in a stream and finding a file which
contains a string are 2 separate operations (at least, they are for me).
It seems to me that grep has been overloaded (to use C++ parlance) to
do both. Both operations are needed, but if unix philosophy were
followed correctly [1] then perhaps they shouldn't have been built into
the same command. It doesn't really bother me. :-)
[1] each tool does one simple job, and does it well.
--
Regards,
Paul Gearon
Software Engineer Telephone: +61 7 3876 2188
Plugged In Software Fax: +61 7 3876 4899
http://www.PIsoftware.com PGP Key available via finger
Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
immane mittam.
(Translation from latin: "I have a catapult. Give me all the money,
or I will fling an enormous rock at your head.")
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'. See http://www.humbug.org.au/
More information about the General
mailing list