Delivered-To: listarch-cygwin AT sourceware DOT cygnus DOT com Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <3.0.5.32.19990216000426.00825350@pop.ne.mediaone.net> X-Sender: phumblet AT pop DOT ne DOT mediaone DOT net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Tue, 16 Feb 1999 00:04:26 -0500 To: Christopher Faylor , From: "Pierre A. Humblet" Subject: Re: sources In-Reply-To: <19990215231439.B11574@cygnus.com> References: <36C856B3 DOT E5010221 AT dddandr DOT octacon DOT co DOT uk> <36C856B3 DOT E5010221 AT dddandr DOT octacon DOT co DOT uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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: ~: 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