I'm trying to understand some kernel level concepts in Linux. I was checking on the difference between shell builtin commands and the other executable commands.
This wonderful answer clearly tells the difference and also specifies the need for shell builtin commands.
Now I know that using
type <command-name>, I could check if it is an external or shell builtin command.
So I decided to do some
strace'ing on the various commands to understand more of the internals.
I learned this neat little trick to do
strace'es on shell builtin commands. I was able to do
cd .. as well according to the above answer.
Now when I run
type pwd and get the output as,
pwd is a shell builtin. So, I expect that I wouldn't be able to run
strace on it, since it too is a shell builtin. But when I did an
strace on it, I was surprised to see that
strace worked without the need to do
echo as well and it worked fine too.
So my understanding is, that
strace worked in the case of
echo because the execution of
echo did not change any of the shell's behavior.
Am I correct in my understanding?