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

Re: Command wrappers in $PATH, and re-executing the "correct" value



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