Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Feb 2017 10:02:02 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Cy Schubert <Cy.Schubert@komquats.com>
Cc:        Alan Somers <asomers@freebsd.org>, scrappy@freebsd.org, Brian Somers <brian@freebsd.org>, freebsd-bugzilla@ayaken.net, Cy Schubert <cy@freebsd.org>, pkg@freebsd.org
Subject:   Re: Bug 217055 - Consolidate random sleeps in periodic scripts
Message-ID:  <86zihmwlth.fsf@desk.des.no>
In-Reply-To: <201702160054.v1G0sLt8048117@slippy.cwsent.com> (Cy Schubert's message of "Wed, 15 Feb 2017 16:54:21 -0800")
References:  <201702160054.v1G0sLt8048117@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Cy Schubert <Cy.Schubert@komquats.com> writes:
> "Dag-Erling Sm=C3=B8rgrav" <des@des.no> writes:
> > This won't work, because && forks.  You need:
> >=20
> >    if [ -t 0 ] ; then ... ; fi
> Are you sure?

Maybe it varies from shell to shell...  or maybe I confused it with
other constructs like 'grep foo bar | while read line' (which definitely
doesn't work).  I consider it bad style, but that's a matter of taste.
I prefer to use && and || only for error conditions and loop control.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86zihmwlth.fsf>