bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with env and perl


From: Paul Jarc
Subject: Re: Problems with env and perl
Date: Wed, 17 Apr 2002 14:08:06 -0400
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i686-pc-linux-gnu)

JW <address@hidden> wrote:
> I sent this the the sh-utils address but thought I'd post it here too, in
> case someone already knows the answer

I'd suggest comp.unix.programmer, or maybe comp.unix.shell or
comp.lang.perl.

> It works on the command line, as show below, but as the #! in a script it
> fails, treating the argument as part of the executable's name, as if it was
> quoted.

The exact behavior varies among OSes, but yes, it will usually fail in
one way or another.  E.g., Linux behaves the way you describe, while
Solaris passes just the first argument (perl) to the interpreter
(/usr/bin/env) and ignores the rest of the line.

> Please, is there any way to get env to envoke perl with the -w and -T
> options?

I don't think it can be done with env, but I've heard this works:
#!/bin/sh
#! -*-perl-*-
eval 'exec perl -xTw "$0" ${1+"$@"}'
  if 1==0;


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]