From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 10 05:31:21 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 804491065673 for ; Sun, 10 Oct 2010 05:31:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from out-0.mx.aerioconnect.net (outp.internet-mail-service.net [216.240.47.239]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5E68FC18 for ; Sun, 10 Oct 2010 05:31:21 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o9A5VKlJ014740; Sat, 9 Oct 2010 22:31:20 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 804CA2D6015; Sat, 9 Oct 2010 22:31:19 -0700 (PDT) Message-ID: <4CB14FD5.9090505@freebsd.org> Date: Sat, 09 Oct 2010 22:32:05 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 MIME-Version: 1.0 To: Garrett Cooper References: <1286397912.27308.40.camel@localhost.localdomain> <51B4504F-5AA4-47C5-BF23-FA51DE5BC8C8@vicor.com> <238E0B24-AA12-4684-9651-84DA665BE893@vicor.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: Brandon Gooch , freebsd-hackers@freebsd.org, Devin Teske Subject: Re: sysrc -- a sysctl(8)-like utility for managing /etc/rc.conf et. al. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 05:31:21 -0000 On 10/9/10 7:30 PM, Garrett Cooper wrote: > >> [ "..." ] is the same thing as [ -n "..." ] or test -n "..." >> [ ! "..." ] is the same things as [ -z "..." ] or test -z "..." >> I'll never understand why people have to throw an extra letter in there and >> then compare it to that letter. > I ran into issues using ! on Solaris ksh recently (not using test), > and I agree that your example below is more straightforward and > readable than the other examples I've dealt with in the past. Ah that reminds me for the reason for "X$foo" = "X" it's in case $foo evaluates to "-n" or similar... It's been a long time... but these days a data misevaluation leads to such things ad SQL injection attacks and I see no reason that a shell injection attack shouldn't be possible.