The Wanderer <wande...@fastmail.fm> writes:

> On 2021-09-21 at 16:16, Michael Stone wrote:

>> On Tue, Sep 21, 2021 at 09:00:52AM +0100, Jonathan Dowland wrote:

>>         If you want something with specific portable semantics, just
>> use command -v.

> I think I've seen that suggested a lot as an alternative for 'which',
> but it doesn't seem to be comparably reliable in all contexts.
>
> The primary issue I've run across to date is with aliases.

I don't know if it is always the case, especially with bizarre zsh
setups, but on my computers, aliases are not defined in shell scripts,
only in interactive shells.

If it's an issue, a shell script can do this beforehand:

  \unalias -a

See https://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html

-- 
Fabrice Bauzac-Stehly
PGP 01EEACF8244E9C14B551C5256ADA5F189BD322B6

Reply via email to