help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to override the default executable resolution order of PATH?


From: Dennis Williamson
Subject: Re: How to override the default executable resolution order of PATH?
Date: Sat, 2 May 2020 18:27:17 -0500

On Sat, May 2, 2020, 4:48 PM Peng Yu <address@hidden> wrote:

> Suppose
>
> 1. dir1 is before dir2 in PATH.
> 2. Most of the executables with the same name should be resolved to
> those in dir1 instead of dir2.
> 3. There are a small fraction of executables with the same name should
> resolve to those in dir2.
> 4. dir1 and dir2 can not be modified.
>
> Does anybody know the best way to fine control how the executables are
> resolved to? Thanks.
>
> --
> Regards,
> Peng
>


builtin hash -p /path/to/dir2/executable1 executable1

Or create a wrapper script which runs the executable in dir3 and add dirt
to the beginning of PATH.

>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]