| Summary: | Error in the pwd man page | ||
|---|---|---|---|
| Product: | Documentation | Reporter: | Slawomir Wojciech Wojtczak <vermaden> |
| Component: | Manual Pages | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed Not A Bug | ||
| Severity: | Affects Many People | CC: | doc, markj |
| Priority: | --- | ||
| Version: | Latest | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Slawomir Wojciech Wojtczak
2019-03-15 22:27:23 UTC
The code suggests otherwise:
physical = 1;
while ((ch = getopt(argc, argv, "LP")) != -1)
switch (ch) {
case 'L':
physical = 0;
break;
case 'P':
physical = 1;
break;
It also appears to work as documented:
> mkdir foo
> ln -s foo bar
> cd bar
> /bin/pwd
/home/mark/foo
> /bin/pwd -L
/home/mark/bar
>
I suspect the problem is that the shell may provide its own pwd builtin which does indeed behave differently.
(In reply to Mark Johnston from comment #1) So shell builtin (ZSH) behaves correctly with POSIX standards. IMHO FreeBSD should also be correct with POSIX standards so option -L should be assumed in FreeBSD's pwd. I am not gonna 'fight' for this - you will do what you want - but that is my opinion. Regards, vermaden (In reply to vermaden from comment #2) It's mostly a question of whether changing the default will break existing scripts. sh, bash and zsh use a builtin implementation for pwd, but tcsh in the base system does not, so I expect that such a change would cause a fair amount of pain. We should update the pwd(1) man page to note that we are not compliant with the standard. |