* Stefan Seyfried
Am 30.03.2013 16:44, schrieb Guido Berhoerster:
* Andreas Schwab
[2013-03-30 16:24]: type -p is what you want.
No, it isn't, you want "command -v". In contrast to the "type" bashism, it is specified by POSIX, implemented as a regular builtin in all Bourne-derived shells present in Factory, and perfectly capable of covering the most common use-case of "which", namely printing the pathname of the given utility while taking PATH into account.
But both are not equivalent to "which":
seife@susi:~> which ls /usr/bin/ls seife@susi:~> type -p ls seife@susi:~> command -v ls alias ls='ls $LS_OPTIONS'
That is no relevant for script use since there are no aliases in a non-interactive shell. And in case of regular and special builtins as well as functions which shadow utilities in PATH, the name of the builtin/function will be printed back. -- Guido Berhoerster -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org