Ah, in C, 0 means false and 1 means true, but in UNIX in general, a program that exits with _no_ error returns 0, and otherwise returns non-0. It makes sense if you think of the fact that it returns with whether or not it returned false. Did I have an error? No - return 0 (error false) Yes - return non-0 (error true) It took me a little while to see this logic :) Gabe On Tue, Nov 14, 2000 at 03:17:07PM -0600, David Christian wrote: > > > > dopp at acm.cs.umn.edu wrote: > > > > > > On Mon, Nov 13, 2000 at 11:46:17AM -0600, Kent Schumacher wrote: > > > > I typically string 3 or four servers coupled by &&'s in case one of > > > > the servers is down. For example... > > > > > > > > ntpdate time.nist.gov && ntpdate for.a.good.time.call.gov && ntpdate > time.enough.org > > > > > Aren't error codes returned as numbers other than 0 and a regular exit a 0? > > If that's the case, and 0 is treated as false, then you *do* want to use && > for this. > > Thanks, > Dave > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tclug-list-unsubscribe at mn-linux.org > For additional commands, e-mail: tclug-list-help at mn-linux.org -- -------------------------------------------------------------------------------- Gabe Turner | X-President, UNIX Systems Administrator, | Assoc. for Computing Machinery U of M Supercomputing Institute for | University of Minnesohta Digital Simulation and Advanced Computation | dopp at acm.cs.umn.edu "Be nice to him [Kowalski] because he's the product of your loins!" -- Stimpy "My fake loins!!" -- Ren Hoek - Ren takes on fatherhood in "Fake Dad" --------------------------------------------------------------------------------