This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: behaviour of "for (( exp1; exp2; exp3 )); do COMMANDS; done"
Harald Maier <maierh@myself.com> wrote in <m3fzmyayjc.fsf@ate.maierh>
in gmane.os.cygwin on Thu, 29 May 2003 11:32:23 +0200:
> >> Some people are using the env program to use the PATH environment:
> >> #! /usr/bin/env perl
> >> BEGIN { $^W = 1 }
> > Erm ... doesn't this just duplicate the problem? How can you guarantee
> > that "env" is always in /usr/bin?
> > It's also pretty inefficient, isn't it?
> It gives you the freedom to start different interpreters with the same
> script. E.g. perl-5.6 or perl-5.8. This might be interesting for
> testing purposes. What are you looking for?
I was looking for portability of scripts where the script interpreter
may not be in the same location e.g. bash is /bin/bash on Linux and
Cygwin but may be /usr/bin/bash or /usr/local/bin/bash or even
$HOME/bin/bash on another system.
The obvious idea would be for the code that handles "#!/bin/xxxx" to
look in the $PATH if xxxx doesn't exist in /bin - but there are
security concerns with this approach, of course.
Anyway, the whole discussion is not Cygwin specific. If anyone wants
to discuss it further then e-mail me direct. (You'll have to make my
e-mail address less sleepy to do so.)
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/