According to help command
, the help of bash, command
can be used to trigger the external program x, if x exists as a builtin function too:
command: command [-pVv] command [arg ...]
Execute a simple command or display information about commands.
Runs COMMAND with ARGS suppressing shell function lookup, or display
information about the specified COMMANDs. Can be used to invoke commands
on disk when a function with the same name exists.
When testing with time
, this works as expected and uses the external program /bin/time
, but when I try:
command echo --help
# the output is
--help
which is the expected behavior for the builtin echo
.
Using xubuntu 22.04, bash 5.1.16 /bin/echo --help
works as expected.
Do I misunderstand the command
command? Or why doesn't it work as announced? How can I find out?
GNU bash, Version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.