Re:How does `cd` work?
by wodenokoto on Friday March 02, 2018 @02:23AM
(#16499755)
She says that it is all a ton of functions that sanitize input and implement logic before calling chdir.
So the article does point out that CD isn't a direct alias for chdir
> The Bash shell invokes the chdir function.
Nope! Not quite.
Bash:
Raw chdir and getcwd syscalls: See the difference? While of course the shell will invoke chdir, it has its own idea of a current working directory, and translates the argument of cd to something else. For instance cd .. doesn't translate to (chdir "..").