News for hackers. Stuff that matters.
Re:How does `cd` work? by ifbizo on Thursday March 01, 2018 @04:32PM (#16496570)
To elaborate, I really enjoyed reading Dennis Ritchie give some background on the evolution of Unix[1]:

> As a historical curiosity, in the very first versions of Unix chdir was a normal command rather than a shell builtin.

> You see, at that point Unix had no fork system call. There were multiple processes, but they were created statically at startup rather than on-demand. Running a command in the shell would cause the command to replace the shell in the address space of the process, and the process quitting would put the shell back in there.

> This worked perfectly with cd being a normal command. Then they implemented fork() and were for a while very confused trying to debug how in the world fork() could have broken the chdir() system call :)

[1] https://www.bell-labs.com/usr/dmr/www/hist.html

Re:How does `cd` work? by LukeShu on Thursday March 01, 2018 @04:39PM (#16496627)
To clarify, these are very early revisions of Unix we're discussing, prior to Research Unix v1. By the time v1 happened, fork existed, and `chdir` was a shell builtin.