On Tue, 2004-03-30 at 03:47, Mary Gardiner wrote:
> Hi folks,
>
> I'm accustomed to starting my various Python and Perl files with:
>
> #!/usr/bin/env python
>
> or
>
> #!/usr/bin/env perl
>
> to deal with the situation where the python or perl binary lives in
> different places on different systems (please don't reply suggesting I
> just move it or just install Debian or something, some of us still work
> in archaic environments where we don't have root on servers we use!!!!)
>
> However, you can't pass arguments to whatever you're invoking, thanks to
> the limits of the #! interpretion ("#!/usr/bin/env perl -w" at the top
> of a file causes a search for a binary named "perl -w"). What workaround
> do people use for this problem in general? (I know -w is equivalent to
> "use warnings;" so I know the Perl workaround)
In general I've found the easiest way is the cop-out of making a wrapper
script that finds perl/python (or in my case I have the wrapper script
generated out of a make rule that substitutes the appropriate
system-specific values) and execs it along with any arguments you need.
Pretty messy, but it's the best I've come up with in the past. I'd also
be interested in a better way.
HTH,
James.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html