5 ms·
Ask HN: Why is CD.. in the root directory not an error?
The title says it all. Why is the resulting status code 0?
$ cd /
$ cd ..
$ echo $? # is 0, but shouldn't that be 1?
- josephcsible 4y agoIf ".." didn't exist in the root directory, then it would be an error. But it does exist, and it just points back at itself like "." does.
- simonblack 4y agoJust like zero is the lowest number you can obtain in an unsigned number series. 0 -1 = 0;