help-bash
[Top][All Lists]
Advanced

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

Re: What can affect whether a comamnd is found in PATH?


From: Alex fxmbsw7 Ratchev
Subject: Re: What can affect whether a comamnd is found in PATH?
Date: Thu, 24 Jun 2021 11:35:26 +0200

$PATH is the only paths it searches in, bot there no direct command
you can try it to contain . and .. and $HOME ..

On Wed, Jun 23, 2021, 20:33 Peng Yu <pengyu.ut@gmail.com> wrote:

> Hi,
>
> $ type -P cmd
>
> I am trying to find a command using the above command. But it finds
> nothing.
>
> Then I call the command with its abspath.
>
> $ /abs/path/cmd
>
> Then I can find the command. I also run `hash -r` before. But it didn't
> help.
>
> $ type -P cmd
> /abs/path/cmd
>
> `type` is the following builtin.
>
> $ type type
> type is a shell builtin
>
> This looks weird. Does anybody know how to debug this issue?
>
> Can I exclude the possibility that this is caused by a bug in this
> version of bash?
>
> $ bash --version
> GNU bash, version 5.1.8(1)-release (x86_64-apple-darwin20.3.0)
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
>
> This is free software; you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> --
> Regards,
> Peng
>
>


reply via email to

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