Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 2026 12:14:25 -0800
From:      "Jin Guojun[VFF]" <jguojun@gmail.com>
To:        Chris Hill <chris@monochrome.org>
Cc:        questions@freebsd.org
Subject:   Re: pwd default behavior
Message-ID:  <293c194d-8eaa-4887-adf9-9f2c06006a6c@gmail.com>
In-Reply-To: <alpine.BSF.2.20.2602061316270.53186@tripel.monochrome.org>
References:  <877bsqe6m0.fsf@x1.laptops.machines> <86ms1lbzsd.fsf@ltc.des.dev> <6384c7bf-e66f-4baf-8b23-0e3b16e1a7f9@gmail.com> <alpine.BSF.2.20.2602061316270.53186@tripel.monochrome.org>

index | next in thread | previous in thread | raw e-mail

On 2/6/26 10:18, Chris Hill wrote:
> On Fri, 6 Feb 2026, Jin Guojun[VFF] wrote:
>
>> On 2/6/26 08:30, Dag-Erling Sm?rgrav wrote:
>>> Simon Wollwage <rootnode+freebsd@wollwage.com> writes:
>>>> While reading the code for /bin/pwd, I noticed that the default 
>>>> behavior
>>>> in the code is to assume -P if no arguments are supplied, but 
>>>> according
>>>> to POSIX it shoud be -L
>>>> (https://pubs.opengroup.org/onlinepubs/9799919799/utilities/pwd.html)
>>>>
>>>> Is it for convenience reasons or other technical reasons? Seems 
>>>> like an
>>>> easy change to make it compliant.
>>> It makes very little difference in practice as pwd(1) is usually a 
>>> shell
>>> built-in, but: https://reviews.freebsd.org/D55146
>>>
>>> DES
>>
>> It does make some difference because one wants to know where one 
>> really is at :-)
>>
>> Since there is another command "dirs" which does "pwd -L", so pwd 
>> defaulting to -P makes sense to provide the real location.
>
> `dirs` exists in csh. In my shell, /bin/sh, there is no `dirs` and 
> `pwd` defaults to the -L behavior.
>
The man page should be updated to reflect the different behaviors 
between sh and csh.



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?293c194d-8eaa-4887-adf9-9f2c06006a6c>