X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 	tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <20091225031926.GA8496@panix.com>
References: <20091225031926.GA8496@panix.com>
Date: Thu, 24 Dec 2009 23:49:03 -0500
Message-ID: <f60fe000912242049t5248f366x4f077b57260961a6@mail.gmail.com>
Subject: Re: bash expands $1 in strange new way
From: "Mark J. Reed" <markjreed@gmail.com>
To: arnstein@pobox.com, cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@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

On Thu, Dec 24, 2009 at 10:19 PM, David Arnstein wrote:
> I have a bash shell script named xplo that worked as desired under
> cygwin 1.5. It fails under cygwin 1.7.

Your shell script is incorrect, and I don't see how it worked under
1.5. This line:

> =C2=A0 =C2=A0 =C2=A0 =C2=A0set EXPLOR=3D'/cygdrive/c/windows/explorer.exe'

does NOT set a variable named EXPLOR.  Instead, it sets the first
positional argument ($1) to the string
"EXPLOR=3D/cygdrive/c/windows/explorer.exe".  Whatever the old value of
$1 was, it's now gone.

To fix, get rid of the "set".  In sh and derivatives, "set" sets the
positional arguments (and optionally flags that affect the shell's
behavior); it does NOT set variables.  Just use the assignment syntax
(var=3Dvalue) by itself for that.

--=20
Mark J. Reed <markjreed@gmail.com>

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

