Delivered-To: listarch-cygwin@sourceware.cygnus.com
Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
From: Christopher Faylor <cgf@cygnus.com>
Message-ID: <19990216002701.A12208@cygnus.com>
Date: Tue, 16 Feb 1999 00:27:01 -0500
To: "Pierre A. Humblet" <Pierre.Humblet@eurecom.fr>,
        cygwin@sourceware.cygnus.com
Subject: Re: sources
References: <36C856B3.E5010221@dddandr.octacon.co.uk> <36C856B3.E5010221@dddandr.octacon.co.uk> <19990215231439.B11574@cygnus.com> <3.0.5.32.19990216000426.00825350@pop.ne.mediaone.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.93i
In-Reply-To: <3.0.5.32.19990216000426.00825350@pop.ne.mediaone.net>; from Pierre A. Humblet on Tue, Feb 16, 1999 at 12:04:26AM -0500

On Tue, Feb 16, 1999 at 12:04:26AM -0500, Pierre A. Humblet wrote:
>At 11:14 PM 2/15/99 -0500, Christopher Faylor wrote:
>>If someone can point me to some documentation that proves that ash is not
>>working like a standard UNIX /bin/sh, then I'll be happy to change my mind.
>
>That's a good point. Where can we find documentation about ash? 
>From experimenting with it, it looks like ash can do more than (some)
>sh.  For example the %% construct can be used to test if an argument is
>a switch.  However this feature doesn't work reliably:

This is exactly the opposite of the point I was making.  I don't care AT
ALL about the %% construct unless someone can show me somewhere where
this is documented for a UNIX /bin/sh.  So, demonstrating how it
works with ash currently is fruitless.  We already know that it isn't
working right.

As far as i can tell now, the %% behavior should be expunged from ash
I will try to do that for the next release.

cgf

>~: sh try_ash yyy
>Test 1 yyy
>is not a switch
>Test 2 yyy
>is not a switch
>
>~: sh try_ash -yyy
>Test 1 -yyy
>is a switch
>Test 2 -yyy
>is not a switch
>
>Using sh on a SUN yields:
>1-chablis$ sh try_ash yyy
>try_ash: bad substitution      
>
>Pierre
>
>********************
>#This file checks if arg1 is a switch
>b=${1%%-*}
>echo Test 1 "$1"
>if test -z "$b"
>then 
> echo is a switch
>else 
> echo is not a switch
>fi
>
>#Now it tries a direct test
>echo Test 2 "$1" 
>if test -z "${1%%-*}"
>then 
> echo is a switch
>else 
> echo is not a switch
>fi
>

-- 
cgf@cygnus.com
http://www.cygnus.com/

