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

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



On Fri, Sep 08, 2017 at 01:30:05PM +0200, Mikael Magnusson wrote:
> This works fine if you start zsh as sh though, ie [...] ARGV0=sh zsh

For the benefit of other people who like myself, don't use actually Z
shell, this is NOT the equivalent of "ARGV0=sh zsh" in many (most?)
other shells, it's describing execve("sh", ["zsh", ...]):

    # For POSIX shells, you can use Z shell itself assuming there's not
    # a standardized built-in way I overlooked:
    $ zsh -c "ARGV0=sh zsh ..."

    # For Bash (and some others):
    $ (exec -a sh zsh ...)

Eric



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