From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11991 invoked by alias); 18 Dec 2013 04:08:01 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11974 invoked by uid 89); 18 Dec 2013 04:08:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Dec 2013 04:07:59 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBI47vc2018326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 Dec 2013 23:07:58 -0500 Received: from [10.3.113.161] (ovpn-113-161.phx2.redhat.com [10.3.113.161]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBI47vB7029939 for ; Tue, 17 Dec 2013 23:07:57 -0500 Message-ID: <52B11F9C.9050100@redhat.com> Date: Wed, 18 Dec 2013 04:08:00 -0000 From: Eric Blake User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: Change in behavior of bash / if [ References: <6CF2FC1279D0844C9357664DC5A08BA21F8C0A@MLBXV06.nih.gov> In-Reply-To: <6CF2FC1279D0844C9357664DC5A08BA21F8C0A@MLBXV06.nih.gov> OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hRv6IGb7MqkQPuliG0XUQeCfv1OjKimxl" X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00314.txt.bz2 --hRv6IGb7MqkQPuliG0XUQeCfv1OjKimxl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-length: 1221 On 12/17/2013 08:02 PM, Buchbinder, Barry (NIH/NIAID) [E] wrote: > Today, a script that I use every day stated giving me the following > error message. (I grant that it might have started earlier and I > didn't notice.) Note that although it gave the error message, the > script seems to still have worked. >=20 > ./lddir: line 77: [: too many arguments >=20 > Line 77 was as follows. I'm testing whether $1 is "clip". >=20 > if [ x$1 =3D xclip ] What was $1 at the time? >=20 > I fixed it with this. >=20 > if [ "x$1" =3D xclip ] Yes, this is the correct fix for the improper quotation of the earlier example. >=20 > 32-bit, everything was up to date. >=20 > I've solved my problem, but the change was unexpected and, for me, > inexplicable, so I thought that I'd report it. Your quoting error would produce the same message on Linux; it is not cygwin-specific. >=20 > Let me know if you want/need more information. Without knowing how $1 was set, I can only guess that it contained something with characters in $IFS and therefore the word-splitting of the unquoted use caused too many arguments to [. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hRv6IGb7MqkQPuliG0XUQeCfv1OjKimxl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 621 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSsR+cAAoJEKeha0olJ0Nq1zoH/ROCkDXRSGYncgBdwrJEOXRz AAa6ecKTTEkxD5aFrSeF09K44TWwGgAEeBxJ9gHKVpXyxozRwStfBoErinJnKUOO I9pi3AqXXHWboij41pAIGdTwy5pQq4/YEGaZI1/8IS28fcQwA34Q4wXiPvYScMV5 IrOSDgO7hiINbF+YC8rS0KfKK5l47hbx0V3HF1pIa5SZ0JJkv4MTdWmyFabnVtOk uM/OfgWOo3CEPlfJR/fhJKfvL9E6xj75A0gfDiPns+TwC8Na8Ec8Sn1H+BmTYAwo EGUfL1LJURmjAf47BRc7xz4tXfiJC3LZ31FOm4nquhFMVDTP1nLvRwsFX7VF/HM= =7qRt -----END PGP SIGNATURE----- --hRv6IGb7MqkQPuliG0XUQeCfv1OjKimxl--