This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: behaviour of "for (( exp1; exp2; exp3 )); do COMMANDS; done"

Sam Edge <> writes:

> Stuart Brady <> wrote in
> <>
> 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.

Some people are using the env program to use the PATH environment:

#! /usr/bin/env perl
BEGIN { $^W = 1 }


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]