| ▲ | torben-friis 7 hours ago |
| So you can be at A, run a successful absolute path cd, then do something bad like a bulk remove in the current directory, and you nuke A? What a footgun. |
|
| ▲ | andOlga 7 hours ago | parent [-] |
| `cd` does not travel to an "absolute path". It changes the working directory for the specified drive. Your prompt will still show you the old path (at A:), because you've not changed the folder for the current working drive, which yes, is kind of an insane concept. If you want to actually change the working directory and drive at the same time (which is the "absolute path" idea you have), you do `cd /d D:\whatever\`. |
| |
| ▲ | torben-friis 7 hours ago | parent [-] | | Yeah I understood how it actually works, I'm just saying it's a potential huge footgun for someone writing a script coming from unix derivates. At least if I had to write one, I saw cd is available and seemingly working as expected, and wrote a cd to an arbitrary target I would not expect it to behave that way at all - my expectation would be that either the next command always runs in the cd'd path, or at least that cd errors on a path in a different drive. | | |
| ▲ | not_a_bot_4sho 7 hours ago | parent [-] | | I get the foot gun concern. But it's true going the other direction too. Whether or not the gun fires comes down to what you're most accustomed to |
|
|