On Sun, 09 Dec 2007 13:19:51 -0800 Micah Cowan wrote:
> I believe I already answered this: it is because a non-zero exit > status always means "something's wrong". Myriad scripts invoke > utilities in ways similar to: > > if ! wget http://foo.com/ > then > echo "Something went wrong with the download." > fi > > If Wget starts using non-zero to mean a "special" kind of success, > scripting suddenly becomes much more complicated (and Wget suddenly > ceases to be "Unixy"). 'Something wrong' seems to be a somewhat semantic issue, and depends on your outlook. When grep doesn't return a zero exit code, it doesn't mean there's something wrong. Just that it didn't find the string. If you are trying to ensure the string isn't there, the non zero exit code is telling you that there's something right. - Richard. -- Richard Kimber http://www.psr.keele.ac.uk/