This question already has an answer here:
- Why is echo a shell built in command? 6 answers
I was playing around with the
which commands and I discovered something strange.
type either returns the path or says that a command is a Bash built in.
which either returns the path or nothing for built ins such as
What is strange is that
type echo says that echo is a built in as I expected.
which echo gives /bin/echo as the path to the echo executable. This doesn't seem to happen for any other built in commands.
I am wondering what the different between the two is, which one Bash chooses to execute in scripts and on the command line, and what the story behind the two echos is.
My system is Ubuntu Desktop 12.04