Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Message-ID: <427F5C1C.6050202@byu.net>
Date: Mon, 09 May 2005 06:48:28 -0600
From: Eric Blake <ebb9@byu.net>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: john@morrison.mine.nu
CC: cygwin@cygwin.com
Subject: Re: base-files patch (atn: Eric Blake)
References: <032520051926.2104.424465D60002AFD30000083822058861720A050E040D0C079D0A@comcast.net> <1492.192.168.0.12.1115538762.squirrel@mail.morrison.mine.nu>
In-Reply-To: <1492.192.168.0.12.1115538762.squirrel@mail.morrison.mine.nu>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

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

According to John Morrison on 5/8/2005 1:52 AM:
> On Fri, March 25, 2005 8:26 pm, Eric Blake said:
> 
>>True enough.  And that points out another bug - echo "$0" may fail if $0
>>starts with -, it should be echo -- "$0".  Isn't portable shell
>>programming fun?
> 
> Sorry that this has taken so long, but I'm just getting around to adding
> all the fixes emailed wrt /etc/profile.  I tried the above, and it broke
> so I checked the man pages,

Serves me right for thinking that echo was standard when I typed my
original message, rather than me actually testing at the command line.
Yes indeed, POSIX requires that echo must interpret -- as a string
operand, rather than the standard interpretation of being an argument
separator.

> so, I'm afraid that echo -- "${0}" won't work.
> 

This will work instead:
case `printf %s "$0" | /usr/bin/tr '[:upper:]' '[:lower:]'` in
bash | -bash | */bash )
[..]

- --
Life is short - so eat dessert first!

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

iD8DBQFCf1wc84KuGfSFAYARAg5qAJ9M9WVxgQhBUc9edDMtZZirq8/JIACfbw2t
KQ0laPFFkGEIWyjP3xHaJB8=
=r+l4
-----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/

