It is not built-in cd, and in fact it does not work, except to indicate whether the directory can be changed by rejecting a non-zero exit status if it cannot.
Try:
"$(which cd)" /
... will do nothing.
The actual inline inline cdis part of your C shell and calls syscall chdir(). This syscall updates your process status - tracked by the kernel - to work with another working directory.
... , script? :
builtin `echo ${0##*/} | tr \[:upper:] \[:lower:]` ${1+"$@"}
... -, echo ( , - ), tr , , cd, cd.
... second, ${1+"$@"} ("$@") , , (${foo+bar} bar, foo ).
, shell-builtin cd (, , syscall chdir()), . , , , , , , , shebang #!/bin/sh, , .
, cd? , Busybox ash.
source
share