cvs commit: src/etc rc.subr

Yar Tikhiy yar at comp.chem.msu.su
Thu Jul 27 19:21:20 UTC 2006


On Wed, Jul 26, 2006 at 11:59:51AM -0700, Doug Barton wrote:
> Yar Tikhiy wrote:
> > On Tue, Jul 25, 2006 at 10:27:49PM -0700, Doug Barton wrote:
> >> Yar Tikhiy wrote:
> >>> yar         2006-07-25 17:20:22 UTC
> >>>
> >>>   FreeBSD src repository
> >>>
> >>>   Modified files:
> >>>     etc                  rc.subr 
> >>>   Log:
> >>>   Avoid extra runs of test(1) by using its built-in logical operations.
> >>>   
> >>>   Revision  Changes    Path
> >>>   1.63      +9 -15     src/etc/rc.subr
> >>>
> >>> http://www.FreeBSD.org/cgi/cvsweb.cgi/src/etc/rc.subr.diff?&r1=1.62&r2=1.63&f=h
> >> I'm pretty sure that this commit has the opposite effect from what you
> >> intended. If you do:
> >>
> >> [ foo -a bar ]
> >>
> >> then the bar test will always be run, whereas if you do
> >>
> >> [ foo ] && [ bar ]
> >>
> >> bar won't run unless foo succeeds.
> > 
> > I believed test(1) was smarter than that.  But as a matter of fact,
> > -a won't skip bar even if foo is false, neither will -o if foo is
> > true.  Is this a bug or a required feature?
> 
> If it makes you feel any better, I thought the same way you did, and learned
> my lessons the hard way. :)

I hope that this isn't sacred knowledge and I won't be stabbed in
the back by an assassin for having uncovered it in the manpage :-)

-- 
Yar


More information about the cvs-src mailing list