Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
From: Sam Edge <sam.edgeZZZ@lineone.net>
To: cygwin@cygwin.com
Subject: Re: behaviour of "for (( exp1; exp2; exp3 )); do COMMANDS; done"
Date: Wed, 28 May 2003 11:17:02 +0100
Organization: .
Reply-To: cygwin@cygwin.com
Message-ID: <eq29dvgfdunpptfj4ak084g2lfa22as6m1@4ax.com>
References: <002901c32427$2e1553e0$78d96f83@pomello> <PHENJGDFMJPEBOBLGEMOKENMCBAA.peter.oosterlynck@oracle.com> <ocj6dvc16hc7e702hhe1dktohpm1306oi6@4ax.com> <20030527120718.GA22030@convex.org.uk>
In-Reply-To: <20030527120718.GA22030@convex.org.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Posting-Agent: Hamster/2.0.0.1
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h4SAJBi15773

Stuart Brady <stuart@convex.org.uk> wrote in
<20030527120718.GA22030@convex.org.uk>
in gmane.os.cygwin on Tue, 27 May 2003 13:07:18 +0100:

> On Tue, May 27, 2003 at 12:42:21PM +0100, Sam Edge wrote:
> > Make sure that if your script uses Bash-specific features, it starts
> > with #!/bin/bash and not with #!/bin/sh. That way it'll work anywhere.
> 
> You've made the assumption that bash is always in /bin. I've seen it
> in /bin, /usr/bin, /usr/local/bin, /usr/contrib/bin, and /opt/bash/bin.
> ~/bin would be another likely place for it.

I just _knew_ I shouldn't have said "anywhere." ;-)

Unfortunately this is a general weakness in the "#!/xxxx" syntax.

(OT) Does anyone know if any of the common shells, when they see
"#!/bin/xxxx" at the front of a script, try a $PATH search for an
"xxxx" executable if they can't find "/bin/xxxx"? This would seem like
a good idea to me.

Regards,
-- 
Sam Edge

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

