X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
X-Authority-Analysis: v=1.0 c=1 a=Kd08CeW4Oo0A:10 a=tzBgeO_4N2YA:10  a=xe8BsctaAAAA:8 a=kGmDpy8Kv4cIG7T85pAA:9 a=7rujZakRjvccowPw-c6xs6o7mYwA:4  a=eDFNAWYWrCwA:10 a=rPt6xJ-oxjAA:10
Message-ID: <48AE45E2.8090604@byu.net>
Date: Thu, 21 Aug 2008 22:51:46 -0600
From: Eric Blake <ebb9@byu.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Updated: csih-0.1.7-1
References: <announce.48A789B6.3010103@cwilson.fastmail.fm> <48A78C6F.2050403@cwilson.fastmail.fm> <20080820134209.GN29104@calimero.vinschen.de> <48ADA260.3020901@cwilson.fastmail.fm> <20080821173028.GA24882@calimero.vinschen.de> <48AE2E66.8060704@cwilson.fastmail.fm> <48AE435F.5000600@byu.net>
In-Reply-To: <48AE435F.5000600@byu.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 8/21/2008 10:41 PM:
> You don't necessarily need the extra subshells.
> 
> if shell_fun_call && [ $var -eq "foo" ]
> 
> is valid shell, provided $var is guaranteed to be non-empty, doesn't start
> with any character that might confuse test (such as '-', '!', '(', etc.),
> and doesn't contain whitespace.

Actually, -eq implies numeric comparison, but "foo" is not a number.  And
I prefer test over [ ] (but that's the autoconf side of me speaking).  If
you want to be really robust, write:

if shell_fun_call && test "x$var" = xfoo

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkiuReIACgkQ84KuGfSFAYDOKQCfX+TtTvrVrZs6GuTVEUhKQZV1
/9gAn1f2rowTlldEy5jPa25/myKgkTmG
=fjF5
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

