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 22893
- From: Eric Pruitt <eric.pruitt@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Running "unset path" breaks PATH despite emulation being enabled
- Date: Sun, 10 Sep 2017 21:39:42 -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=70m0qN115sJQmQzLvIr6Pme4vk6+NJmH5F6YXcHTcwc=; b=V7l4lC75Ev6++XRjaldUDH4wOyfOeLifeRrYd+if9cJ6tnrmBzttwm2cJpvdXU8xOp eScg++c5qEjECTeBEza2w3FKDQJVnS5m/PSHRgYiPO5fR6fH0Z5QcZIkQvnTYE9dubNt jUSB6yQHzGzK7N6NeYXrhhNtthZW8AprsQD+8CJO8RrC6w/xBUsWR9e2JiJDqRjaXNOS DnPj4F41D5vZr8G6V8/Y9X/Q7h+RevqCMRUwC1UZkHJSf4sfnXwFL0Yh47E5MHd7nlOk Z+lcdvtBDpiMdWS04IjcL3w6B+U4U0FFJvTmx0X29HkoKPNsbHyaHUoOULRu1jknC5ae siBg==
- In-reply-to: <170910165057.ZM4703@torch.brasslantern.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> <20170909213806.52qezvyk766loeg3@sinister.lan.codevat.com> <170909152512.ZM9176@torch.brasslantern.com> <20170909223811.mjaoafbhugrijnyb@sinister.lan.codevat.com> <170910165057.ZM4703@torch.brasslantern.com>
On Sun, Sep 10, 2017 at 04:50:57PM -0700, Bart Schaefer wrote:
> On Sep 9, 3:38pm, Eric Pruitt wrote:
> > 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.
>
> OK, that's just a little bit trickier. Here's script equivalent of the
> actual heuristic Bash uses:
>
> # Set $ZSH the way Bash sets $BASH
> [...]
>
> This only works if it's executed before any chdir has been done.
>
> For older zsh that don't have the :P modifier, use :A.
Thanks for taking the time to write out that logic. I use Bash almost
exclusively, and it's been interesting seeing how things are done in Z
shell. In the end I settled for this since the script only needs to
support Linux:
test "${ZSH_NAME:-sh}" = "sh" || exec -a sh /proc/self/exe "$0" "$@"
Of the four shells I'm supporting for the script in question, Z shell is
the only that deviates from POSIX so much that that it requires special
consideration, and I didn't want to add more than a line or two of logic
for it.
Eric
Messages sorted by:
Reverse Date,
Date,
Thread,
Author