From owner-cvs-all@FreeBSD.ORG Thu Jul 27 19:21:20 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BDADF16A4DA; Thu, 27 Jul 2006 19:21:20 +0000 (UTC) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCC7E43D68; Thu, 27 Jul 2006 19:21:14 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.4/8.13.3) with ESMTP id k6RJL9A9007761; Thu, 27 Jul 2006 23:21:09 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.4/8.13.3/Submit) id k6RJL900007760; Thu, 27 Jul 2006 23:21:09 +0400 (MSD) (envelope-from yar) Date: Thu, 27 Jul 2006 23:21:09 +0400 From: Yar Tikhiy To: Doug Barton Message-ID: <20060727192109.GD5075@comp.chem.msu.su> References: <200607251720.k6PHKMau082559@repoman.freebsd.org> <44C6FD55.7040204@FreeBSD.org> <20060726072415.GC79886@comp.chem.msu.su> <44C7BBA7.60109@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44C7BBA7.60109@FreeBSD.org> User-Agent: Mutt/1.5.9i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/etc rc.subr X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jul 2006 19:21:20 -0000 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