Skip to content

What is the order for "type -a"? #10297

Closed Answered by faho
YousufSSyed asked this question in Q&A
Discussion options

You must be logged in to vote

Functions beat builtins beat commands, so that's the order type uses.

The first one it prints is also the one that runs, unless you decorate it like command type (which runs /usr/bin/type) or builtin type (which runs the builtin, ignoring any functions if you have any).

If type -a type ran the type command it could not tell you about the builtins - they only exist inside the shell

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YousufSSyed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants