4 ms·
> 'cd' is defined by the Posix standard (in spite of it needing to be a builtin) I sense you're misunderstanding something, namely that POSIX defines not only
by kazinator 9y ago
> 'cd' is defined by the Posix standard (in spite of it needing to be a builtin)
I sense you're misunderstanding something, namely that POSIX defines not only the names and behavior of a number of common utilities, but also the shell language. There is no "in spite"; POSIX defines the shell syntax features like while, case, if, the various expansions that the shell does and so forth.
By your reasoning, someone's original shell-like scripting language must not have a case statement that is not terminated by esac, and that doesn't have cases terminated by ;; because POSIX requires these. I.e. one mustn't develop a program and call it a "shell" if it isn't a POSIX conforming shell.
cd is a shell feature like while or case; it's effectively a special assignment operator for mutating the shell's current working directory.