On Thu 13/Feb/2025 18:04:52 +0100 karl wrote:
> Hendrik:
> ...
>> What is the type command?
> ...
>
> Type is a shell builtin.
>
> $ man dash | fgrep -A5 'type ['
> type [name ...]
> Interpret each name as a command and print the resolution of the
> command search. Possible resolutions are: shell keyword, alias,
> shell builtin, command, tracked alias and not found. For aliases
> the alias expansion is printed; for commands and tracked aliases
> the complete pathname of the command is printed.
A similar builtin is command -V:
$ man dash | sed -rn '/command \[/,+8p' | sed 5,7d
command [-p] [-v] [-V] command [arg ...]
Execute the specified command but ignore shell functions when searching for it. (This
is useful when you have a shell function with the same name as a builtin command.)
-V Do not execute the command but search for the command and print the resolution of
the command search. This is the same as the type builtin.
So you have:
$ type command
command is a shell builtin
$ command -V type
type is a shell builtin
$ command type type
type is a shell builtin
Best
Ale
--