Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Running "unset path" breaks PATH despite emulation being enabled



On Sat, Sep 09, 2017 at 03:25:12PM -0700, Bart Schaefer wrote:
> > Is there a similar value in Z shell or a built-in I can use?
>
> $ZSH_ARGZERO in sufficiently recent versions of the shell will give you
> the equivalent information, you just have to do the path search part
> yourself

This does not seem to be the case:

    playground$ cp $(which bash) $(which zsh) .
    '/home/ericpruitt/.local/bin/bash' -> './bash'
    '/usr/bin/zsh' -> './zsh'
    playground$ (PATH=/ ./bash -c 'echo $BASH')
    /tmp/tmp.FsPM5kO6Sn/playground/bash
    playground$ (PATH=/ ./zsh -c 'echo =$ZSH_NAME')
    zsh:1: zsh not found

I'm not sure if I misunderstood or didn't clearly explain what I wanted.
What want is for Z shell to return is the name to the invoked
interpreter which is what $BASH shows even when $PATH doesn't contain
Bash.

Eric



Messages sorted by: Reverse Date, Date, Thread, Author