|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
In bash, how can one test whether an executable program is found in
the executable search path? Thanks. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
2007-11-02, 18:32(-00), Russ P.:
> In bash, how can one test whether an executable program is found in > the executable search path? Thanks. if command -v cmd > /dev/null 2>&1; then echo "there is a cmd command available" fi If you want to search for cmd in $PATH and not as a builtin or function, you can use type -P instead of "command -v" but that's bash specific. -- Stéphane |
|
![]() |
| Outils de la discussion | |
|
|