Re:The myriad meanings of pwd in Unix systems
by Joker_vD on Tuesday November 10, 2020 @08:08AM
(#25045505)
DOS actually has "chdir" as another name for "cd".
And of course, the POSIX interface for changing and querying the working directory are wonderfully consistently named chdir and getwd (or getcwd, where "c" stands for something).
Re:The myriad meanings of pwd in Unix systems
by jle17 on Tuesday November 10, 2020 @01:18PM
(#25049157)
Anncient Unix also had chdir as the command name for cd. If I'm not mistaken it was changed to cd for v7 with the Bourne shell replacing the previous shell.
Re:The myriad meanings of pwd in Unix systems
by forgotpwd16 on Thursday November 12, 2020 @01:34PM
(#25073071)
Wouldn't `setwd` (used by R alongside `getwd`) be a more consistent name?
Re:The myriad meanings of pwd in Unix systems
by ben509 on Tuesday November 10, 2020 @07:48AM
(#25045372)
Well, if we ever rewrite Unix, we can just go with "wd".
Because we know it's reading the current or present value, like any other command that reads a value.
And of course we're going to print it, that's the natural thing to do.
Re:The myriad meanings of pwd in Unix systems
by arexxbifs on Tuesday November 10, 2020 @10:31AM
(#25047038)
They sort of did rewrite Unix and it's called pwd there, too. :)
Re:The myriad meanings of pwd in Unix systems
by johnr2 on Tuesday November 10, 2020 @08:45AM
(#25045807)
> if we ever rewrite Unix, we can just go with "wd"
Thus confusing anyone who uses the 'wd' hard disk driver.
Re:The myriad meanings of pwd in Unix systems
by jle17 on Tuesday November 10, 2020 @01:27PM
(#25049272)
Yes when reading the title I thought of <pwd.h> for reading passwd rather than of the command/variable. Also it's already called cwd in other places (like in /proc, at least on Linux) so that would be more consistent.
Thinking more about that though, "cd" in the shell universally means "change (the current working) directory" but can also possibly mean the "current directory" as well (and DOS/Windows "cd" without arguments does print the current working directory). Note that similar abbreviations like "md" and "rd" are not as universal, as they are "mkdir" and "rmdir" in *nixes (for the good reason).