Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Command wrappers in $PATH, and re-executing the "correct" value
- X-seq: zsh-users 27779
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Cc: Zach Riggle <zachriggle@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Command wrappers in $PATH, and re-executing the "correct" value
- Date: Sat, 21 May 2022 09:31:42 +0200
- Archived-at: <https://zsh.org/users/27779>
- In-reply-to: <CAHYJk3Rz2Sqa+ZczcE1cxJGm0Yew4OskHJ+fxwGj=hTWxHc8sQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAMP9c5k0hkXJJjKHGbSzAZ43eKVdGzvTKGYxtZdaXu9EPU-ZvQ@mail.gmail.com> <CAN=4vMoumEB6iUramyMQvn0b6ApMgXjGsNd4eH0zuX_eFpAHFA@mail.gmail.com> <CAHYJk3Rz2Sqa+ZczcE1cxJGm0Yew4OskHJ+fxwGj=hTWxHc8sQ@mail.gmail.com>
On Sat, May 21, 2022 at 9:20 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 5/21/22, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> > path=(${path:#${commands[$1]:h}}) "$@"
>
> I'm using this in mine (wrapper script of same name as target binary),
> path[(R)$0:h]=() exec $0:t "$@"
There is a difference in behavior if the wrapper directory is listed
in PATH more than once. My version removes all of them, while yours
removes only the **last** instance. I can see a point being made for
removing the **first** but removing the last seems wrong. Is this
intended?
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author