From owner-svn-src-all@freebsd.org Mon Dec 7 19:07:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 708F29C19CD; Mon, 7 Dec 2015 19:07:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D7EA1B81; Mon, 7 Dec 2015 19:07:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by oiww189 with SMTP id w189so103237838oiw.3; Mon, 07 Dec 2015 11:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wVeQXL+jkJLZujSJBSSKFHgKHOG4QtrLccDbC4Enu80=; b=Mmzea0TSh93mYpQx71YdeDnZ80+axgypZ21WKMbCV1O3CglkUAgKORmRmUbzg1a6rV jNayTuc24I+2A5tAfhV71qw0AhJz255Sr038wk3VAhISO7cMl6Gs5nyEmbAfaKBiUp10 z7jHteixQ7nRXjAXGA4e5E/v84aqF/DgsYJoA8XCg7bSwgkQPEbLVNJfAFmVMoyPPpI2 C3rl21tGRqtsoUii/2KTK+CRIZ/E/Emi8ImtFRg04aOQDMd5GBy0N/KJQHyPKrZ0g9AL 1odVFOWBWbiwcIeyxjsljIxEhL5BhwKlvOD3KYmhEnHKqyht8b4fXxUj+aLR/dKe17N5 nXqQ== X-Received: by 10.202.45.206 with SMTP id t197mr21093277oit.110.1449515263565; Mon, 07 Dec 2015 11:07:43 -0800 (PST) Received: from [22.34.141.136] ([172.56.8.223]) by smtp.gmail.com with ESMTPSA id a77sm12276284oic.8.2015.12.07.11.07.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 11:07:42 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r291929 - head/tools/tools/nanobsd From: Garrett Cooper X-Mailer: iPhone Mail (13B143) In-Reply-To: <1449512013.1358.6.camel@freebsd.org> Date: Mon, 7 Dec 2015 11:07:40 -0800 Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5FA6DD6B-C70B-4E5A-BD04-5897B02E5FC8@gmail.com> References: <201512071024.tB7AOcjr094296@repo.freebsd.org> <1449512013.1358.6.camel@freebsd.org> To: Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:07:44 -0000 > On Dec 7, 2015, at 10:13, Ian Lepore wrote: >=20 >> On Mon, 2015-12-07 at 10:24 +0000, Warner Losh wrote: >> Author: imp >> Date: Mon Dec 7 10:24:38 2015 >> New Revision: 291929 >> URL: https://svnweb.freebsd.org/changeset/base/291929 >>=20 >> Log: >> Make sure to quote the arg after -n and -z tests. >=20 > While I am generally a quoting fanatic and would much rather overquote > than underquote in shell scripts, fyi it's not actually needed for the=20 > -n and -z tests. test(1) and shells seem to be smart enough to see the > ']' (which is just an arg to test, not shell language syntax) and know > there isn't a string in front of it. Warner's commit was good. There's a more bulletproof way to do this to make i= t more portable (in most cases, not all), but it would be overkill: [ "x$x" !=3D x ] Also, his commit protects against variables with spaces in them doing unexpe= cted things with test(1). Thanks, -NGie=