public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf@cygnus.com>
To: "Pierre A. Humblet" <Pierre.Humblet@eurecom.fr>,
	cygwin@sourceware.cygnus.com
Subject: Re: sources
Date: Mon, 15 Feb 1999 21:26:00 -0000	[thread overview]
Message-ID: <19990216002701.A12208@cygnus.com> (raw)
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/

WARNING: multiple messages have this Message-ID
From: Christopher Faylor <cgf@cygnus.com>
To: "Pierre A. Humblet" <Pierre.Humblet@eurecom.fr>,
	cygwin@sourceware.cygnus.com
Subject: Re: sources
Date: Sun, 28 Feb 1999 23:02:00 -0000	[thread overview]
Message-ID: <19990216002701.A12208@cygnus.com> (raw)
Message-ID: <19990228230200.n3l2SXqKr1HQmCGGE60HAgz5lA35AXXesWnr0EskNa8@z> (raw)
In-Reply-To: <3.0.5.32.19990216000426.00825350@pop.ne.mediaone.net>

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/

  parent reply	other threads:[~1999-02-15 21:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-15  9:20 sources Don Sharp
     [not found] ` < 36C856B3.E5010221@dddandr.octacon.co.uk >
1999-02-15 20:14   ` sources Christopher Faylor
     [not found]     ` < 19990215231439.B11574@cygnus.com >
1999-02-15 21:03       ` sources Pierre A. Humblet
     [not found]         ` < 3.0.5.32.19990216000426.00825350@pop.ne.mediaone.net >
1999-02-15 21:26           ` Christopher Faylor [this message]
1999-02-28 23:02             ` sources Christopher Faylor
1999-02-28 23:02         ` sources Pierre A. Humblet
1999-02-16  9:04       ` sources Henry J. Cobb
     [not found]         ` < 199902160908.5731104.6@www.web-alive.com >
1999-02-16 16:11           ` sources Christopher Faylor
1999-02-28 23:02             ` sources Christopher Faylor
1999-02-28 23:02         ` sources Henry J. Cobb
1999-02-28 23:02     ` sources Christopher Faylor
1999-02-28 23:02 ` sources Don Sharp
1999-02-15  9:49 sources Earnie Boyd
1999-02-15 11:16 ` sources Don Sharp
1999-02-28 23:02   ` sources Don Sharp
1999-02-28 23:02 ` sources Earnie Boyd
     [not found] <000f01be5909$92381800$29acdfd0@InspirePharm.Com>
1999-02-15 11:14 ` sources Don Sharp
1999-02-28 23:02   ` sources Don Sharp
1999-02-16  1:31 sources Don Sharp
     [not found] ` < 36C938C5.D367F910@dddandr.octacon.co.uk >
1999-02-16 17:26   ` sources Christopher Faylor
1999-02-28 23:02     ` sources Christopher Faylor
1999-02-28 23:02 ` sources Don Sharp
2003-03-20 14:53 Sources Nicholas Marsh
2003-03-20 16:16 ` Sources Pavel Tsekov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990216002701.A12208@cygnus.com \
    --to=cgf@cygnus.com \
    --cc=Pierre.Humblet@eurecom.fr \
    --cc=cygwin@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).