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

Re: Handling of *ARGZERO options, for Zsh <= 5.3



On 2 Jan 2018, at 04:17, Sebastian Gniazdowski <psprint@xxxxxxxxxxx> wrote:
>I want to filter out $0 value if it contains path to Zsh binary:

A lot of the time you won't have the path to the zsh binary; it will often just
be the base name:

  % print $ZSH_ARGZERO
  zsh

Even when you have a path you might need to deal with symlinks, &c. On mine
sometimes i'll have /usr/local/bin/zsh and other times it'll have been resolved
to /usr/local/Cellar/zsh/x.y.z/bin/zsh.

On 2 Jan 2018, at 04:17, Sebastian Gniazdowski <psprint@xxxxxxxxxxx> wrote:
>Above works, but for Zsh 5.3 and above. Is it possible to do this with earlier Zshells?

If the problem is ZSH_ARGZERO, shouldn't this work in like 5.0+?

  () {
    setopt local_options posix_argzero
    MY_ARGZERO=$0
  }

dana



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