-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 R Kimber wrote: > 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.
Yes... utilities like grep and test work a little differently, returning true or false, rather than success or failure. I don't see Wget in the same utility space as those. It's much more analagous to cp or mv, to me. Actually, the specific case of timestamping is much more similar to rsync, to me, than anything else. Having Rsync return nonzero when it decided against copying something over because it's not new would be wrong; having Wget return nonzero in the same situation is just as wrong. - -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXs627M8hyUobTrERAo7xAJ904nOmCFgn5ZF6fynRXlISKKG/1gCfXV78 3qWXT+i2R08i9iGb7sOQPOw= =gymS -----END PGP SIGNATURE-----
