${name:c}: Resolve Command Name

Resolves a command name into an absolute paths by searching in $PATH.

This does only work for simple names like command, not for relative paths like dir/command.

Examples

Lookup absolute path of a command
1
2
3
4
known="vim"
echo $known:c
unknown="not-there"
echo $unknown:c
Output:
1
2
/usr/bin/vim
not-there
BashSupport Pro is a Zsh IDE with support for $varName:ctry it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal