[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What can affect whether a comamnd is found in PATH?
From: |
Peng Yu |
Subject: |
What can affect whether a comamnd is found in PATH? |
Date: |
Wed, 23 Jun 2021 13:33:24 -0500 |
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
- What can affect whether a comamnd is found in PATH?,
Peng Yu <=