4 ms·
OK, I don't get `command`. When I run `command time -v sleep 10` it clearly runs /usr/bin/time on my system (the bash builtin doesn't have the -v option), but i
by steerablesafe 5y ago
OK, I don't get `command`. When I run `command time -v sleep 10` it clearly runs /usr/bin/time on my system (the bash builtin doesn't have the -v option), but if I run `command -v time` it outputs `time`, corresponding to the builtin. How is this helpful? Also shouldn't `command` and `command -v` find the same things?
edit: Well apparently this is the standard behavior [1]. So lookup is not the same for `command <name>` vs `command -v <name>`, and there doesn't seem to be a standard way to lookup the executable started by `command <name>`. `which` seem to fill that gap.
[1] https://pubs.opengroup.org/onlinepubs/007904975/utilities/command.html https://pubs.opengroup.org/onlinepubs/007904975/utilities/co...
- kevin_thibedeau 5y agoIf only there was a functioning standards body that could add a new option to command that reported this sort of info.