|
|
|
|
|
by remram
1365 days ago
|
|
cd is a good example of something that has to be a built-in command, because it makes the shell itself do something (change its current working directory). Other commands in that category are umask, the job control ones (fg, bg, wait, ...), the ones setting variables (read, printf), and the control flow ones (if, while, break, return, exit, ...). A lot of commands are also built-in for convenience but don't strictly need to be. |
|
Theoretically you could also have a cd that would IPC the shell to change the pwd but I guess you could also say that is overengineering.