delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/07/28/13:04:04

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3981BCAD.AE1C47A@veritas.com>
Date: Fri, 28 Jul 2000 10:02:37 -0700
From: Bob McGowan <rmcgowan AT veritas DOT com>
Organization: VERITAS Software
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Noel Yap <yap_noel AT yahoo DOT com>
CC: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: shell script bug
References: <20000728163013 DOT 15552 DOT qmail AT web1306 DOT mail DOT yahoo DOT com>

Noel,

I just ran your script with ksh on Solaris and bash on Cygwin:

	./asdf.sh a b '1 2'

and got the same output for both.  I'm using the 1.1.2 net Cygwin and
bash 2.04.0(1)-release.

Noel Yap wrote:
> 
> I have the following script asdf.sh:
> #!/bin/sh
> 
> if [ $# = 1 ]
> then
>   for v in "$@"
>   do
>     echo $# should be 1
>     echo "$v"
>   done
> else
>   for v in "$@"
>   do
>     echo $# isn\'t be 1
>     ./asdf.sh "$v"
>   done
> fi
> 
> Under bash, the output of the script is:
> 5 isn't 1
> 5 isn't 1
> 5 isn't 1
> 5 isn't 1
> 5 isn't 1
> 
> Under sh, there is no output.
> 
> The output (verified on Solaris) should be:
> 5 isn't 1
> 1 should be 1
> a b
> 5 isn't 1
> 1 should be 1
> c d
> 5 isn't 1
> 1 should be 1
> e f
> 5 isn't 1
> 1 should be 1
> g
> 5 isn't 1
> 1 should be 1
> h
> 
> My CYGWIN is set to "export ntea" (if that matters).
> 
> Noel
> 
> __________________________________________________
> Do You Yahoo!?
> Kick off your party with Yahoo! Invites.
> http://invites.yahoo.com/
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan AT veritas DOT com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019