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

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

env won't accept arguments in shebang


From: Todd A. Jacobs
Subject: env won't accept arguments in shebang
Date: Tue, 16 Apr 2002 22:04:30 -0700 (PDT)

Environment: env 2.0.11 on an x86-based Red Hat Linux 7.x machine.

I'm not 100% sure this is a bug, but I can't find an explanation for this
behavior in either the env texinfo file or on the sh-utils FAQ page.  If
you run this command from the shell prompt:

        echo 'print "foo\n"' | /usr/bin/env perl -w

env works as expected. However, the corresponding perl script:

        #!/usr/bin/env perl -w
        print "foo\n"

returns the following error:

        /usr/bin/env: invalid option --  
        Try `/usr/bin/env --help' for more information.

This is true for pretty much any command which is passed an argument. It
works fine from the prompt, but simply won't work on a shebang line. Is
this expected behavior? If so, why?

-- 
"The only thing that helps me maintain my slender grip on reality is the
friendship I share with my collection of singing potatoes."

                        - Holly, JMC Vessel *Red Dwarf*




reply via email to

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