[Gllug] hostname on CentOS

Nix nix at esperi.org.uk
Tue Nov 15 22:34:20 UTC 2005


On Mon, 14 Nov 2005, Tethys announced authoritatively:
> 
> Nix writes:
> 
>>Hence the /dev/null kludge (whose entire raison d'etre is to stop the
>>command reading from stdin if no arguments are added) is unnecessary.
> 
> Not so (although it does that as well). The primary reason is to ensure
> that grep prints the filename as well as the matching line. Without out
> that, you're no wiser than you were before -- you know that *some* file
> in /etc has the info you're looking for, but don't know which one. True,

Aaah. I didn't think of that. Nifty trick.

> with GNU grep, you can use the -H flag to force that, but GNU grep isn't
> available everywhere.

Like GNU make, it should be ;)

>                       Using xargs means that the chances of grep *not*
> printing the filename are slim... but the possibility is still there.

True enuff. Nice one.

-- 
`Holy Google, pray for us sinners now and in the hour of our job interview.'
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list