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: <419B8DAC.60106@x-ray.at>
Date: Wed, 17 Nov 2004 18:43:08 +0100
From: Reini Urban <rurban@x-ray.at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.8a4) Gecko/20040927
MIME-Version: 1.0
To: Geoffrey KRETZ <gk@4js.com>
CC: cygwin@cygwin.com
Subject: Re: long command executed via a variable fails
References: <419B70A9.6020203@4js.com> <419B769E.4060905@x-ray.at> <419B89EE.2080208@4js.com>
In-Reply-To: <419B89EE.2080208@4js.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Geoffrey KRETZ schrieb:
> Reini Urban wrote:
>> FAQ: http://cygwin.com/faq/faq_3.html#SEC43
>> cygwin's /bin/sh is ash, on most other platforms it is /bin/bash.
>>
>> If you want it to behave it exactly like on other platforms, and you use
>> bash specific constructs, use the /bin/bash shebang.
>>
> If I specified  "#! /bin/bash" at the first line of my shell script, is 
> it enough to make Cygwin understand that I want to use bash instead of 
> ash ??

sure. you'd need to do that on every platform if you use bash specifics. 
it is considered good style.

but as igor already posted, your problem is only marginally better on 
bash. you should really use exact quoting: test 'eval "$cmd"'
or even better use Igor suggestions with testing against the return value.
-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

--
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/

