command echo -n "$@"
command here means asking for the
echo command (which happens to be builtin here) instead of the function one which otherwise would take precedence.
And since here,
echo also happens to be a builtin (is not looked-up in
$PATH BTW as builtins have precedence over filesystem commands), you could also do:
builtin echo -n "$@"
That latter approach is preferable in
command echo would run
/bin/echo instead (except in
There are some subtle variations between shells, but the order of precedence is generally:
- special builtins
- commands in
$PATH (and the order depends on the order in
$PATH and in the
hash table as managed by the
Bearing in mind that aliases and keywords in the shell syntax (
if...), when not quoted are considered before those.
The order of
2 is reversed in some shells like
bash doesn't allow functions to be defined with the same name as a special builtin when invoked as