[Top][All Lists]

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

Re: hash not restored after running command -p

From: Mike Jonkmans
Subject: Re: hash not restored after running command -p
Date: Sun, 31 Oct 2021 17:07:04 +0100

On Sun, Oct 31, 2021 at 05:23:03PM +0200, Oğuz wrote:
> 31 Ekim 2021 Pazar tarihinde Mike Jonkmans <bashbug@jonkmans.nl> yazdı:
> >
> > Using the hash as alias for commands, that are not in your PATH,
> > seems risky though.
> Why? Risky how?

Risky, mostly on a cognitive level.

'command -p foo' doesn't look like it has a side effect.

E.g. assume you have /usr/local/bin/foo and /bin/foo
        command -p foo

You would not think that /bin/foo is executed for foo, given the value of PATH.

It could also lead to bugs.
        source script

When the 'command -p foo' is introduced in the sourced script, foo changes.

Regards, Mike Jonkmans

reply via email to

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