env bug ?

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Mar 8 16:44:31 UTC 2005


On Tue, Mar 08, 2005 at 11:38:00AM -0500, Henry Spencer wrote:
> Nope.  I duplicated the problem on a system which quite definitely does
> have /bin/echo.  "/usr/bin/env echo foo" works, but putting the same thing
> in the #! line doesn't.

Hmm, I failed to realize that it was ONLY when done in a file on the #!
that it failed.  You are right it does fail there and yes it appears
that it treats 'echo foo' as a single parameter.  I wonder if env has
some options to tell it to parse its single argument differently, given
it is being passed everything on the #! line as one argument, and then
the filename as the second argument.

Of course if it HAD split echo and foo as two arguments the result would
have been to print out foo and the filename of the script, which is
probably also not what was desired, so it is probably not the right way
to use env in the first place.

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list