Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Running "unset path" breaks PATH despite emulation being enabled
- X-seq: zsh-users 22875
- From: Eric Pruitt <eric.pruitt@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Running "unset path" breaks PATH despite emulation being enabled
- Date: Sat, 9 Sep 2017 14:38:06 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:pgp-key:user-agent; bh=A1ZCjrLc5V++l8BHZ0AviWCUDbIujUYiMB2FkOlw1fY=; b=MK+gjEp1NA7kdYS/ku1NPPsW4A4UPlug8C9BAnyM46IdvQ4m2Oo9Z9jqha7djDV7gA QhHXBygnlNEo3D0xLtkboc6Caaa7JQYLCGIxBVK2rhc+9/cOK6mwcdKL5vuLFggz4S9Q uW5e6M5pjvv0fGUGd3IjcZWvR8cvlswCxhVd7zRLmDsyQlNyjZOcem08rV4wWD3n+nBP L4tZ/J00Ur1HYBkAZCe0J0LoOa0/v50VkqQB+QTLZFQqZdTkZtinU/LIFv6IHPcXTEA2 Nef9GylQoqeXG5X7SCg0lp5AXWTrCMFK0vpQxjmVpxZm35mDksb6Q4sBS+RNFTgTHm8O prEQ==
- In-reply-to: <CAHYJk3RD6p7PwRaZSUbJSAE0Bi6_2+NKLC3MV+32Lh+PmzsAdA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Pgp-key: https://www.codevat.com/pgp.asc#F8601B5D2511B4C3535232488DDDE2E6053692AB
- References: <20170908082917.v5j4vczoq75vs5lk@sinister.lan.codevat.com> <CAHYJk3RD6p7PwRaZSUbJSAE0Bi6_2+NKLC3MV+32Lh+PmzsAdA@mail.gmail.com>
I'm moving this discussion from zsh-workers to zsh-users since it's been
established that the behavior I observed isn't necessarily a bug.
On Fri, Sep 08, 2017 at 01:30:05PM +0200, Mikael Magnusson wrote:
> This works fine if you start zsh as sh though, ie either make a
> symlink ln -s =zsh sh; ./sh or do ARGV0=sh zsh
> It can't really work in the 'emulate sh' case since the parameter
> $path is then already created and it would be quite controversial for
> emulate to remove parameters from the shell environment.
What I ended up doing is adding this to the top of my script:
test "${ZSH_NAME:-sh}" = "sh" || exec -a sh zsh "$0" "$@"
I would like to replace "zsh" with the absolute path of the Z shell
interpreter in case the "zsh" being executed is not the first one listed
in a $PATH folder. After reading through some documentation and
reviewing the output of "set", I don't see a way to do this. For
comparison, Bash sets $BASH to the interpreter's path:
~$ echo $BASH
/home/ericpruitt/.local/bin/bash
Is there a similar value in Z shell or a built-in I can use?
Thanks,
Eric
Messages sorted by:
Reverse Date,
Date,
Thread,
Author