Shell execution ( [was] Re: Value of $? lost in the beginning of a function.)

Glen Barber glen.j.barber at gmail.com
Mon Jul 20 19:19:33 UTC 2009


On Mon, Jul 20, 2009 at 3:12 PM, Doug Barton<dougb at freebsd.org> wrote:
> Glen Barber wrote:
>> Possibly off-topic...
>
> It's very off topic for -stable. If you want to follow up on this,
> please do so in -hackers.
>
>> I meant to say in the last line: "'#!/bin/sh' would override the 'zsh' shell."
>>
>> Can someone enlighten me if I am wrong about this?
>
> It's trivial to create an example to test it yourself, don't ask when
> you can do. :)
>
> #!/bin/foo
> echo yes
>
> $ ./foo
> bash: ./foo: /bin/foo: bad interpreter: No such file or directory
>
> $ sh foo
> yes
>
> $ bash foo
> yes
>
>
> Now it's your turn. :)
>

Hi, Doug.

The test I was going to run was:
---------------------
#!/bin/sh
echo $SHELL
---------------------

which I would execute from $PATH and from 'sh/csh/zsh foo.sh', but I
haven't had much time to play around with it.  I plan on having time
later today after ${JOB}.


-- 
Glen Barber


More information about the freebsd-stable mailing list