I believe the && and || merely looks at output.  For instance, if an error
occurs, something is output to standard error.

For example:

$> ps aux | grep 'mysqld' | ( grep -v 'grep' && echo "MySQL is
running" ) || echo "MySQL is not running!"

and

$> cat /var/log/messages 1>/dev/null || echo "Hey!  You're not root!"

Timothy

On Tue, 14 Nov 2000, 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.

---------------------------------------------------------------------
Timothy Houck
thouck at thouck.com
www.thouck.com