Date: Fri, 6 Feb 2026 09:59:46 -0800 From: "Jin Guojun[VFF]" <jguojun@gmail.com> To: questions@freebsd.org Subject: Re: pwd default behavior Message-ID: <6384c7bf-e66f-4baf-8b23-0e3b16e1a7f9@gmail.com> In-Reply-To: <86ms1lbzsd.fsf@ltc.des.dev> References: <877bsqe6m0.fsf@x1.laptops.machines> <86ms1lbzsd.fsf@ltc.des.dev>
index | next in thread | previous in thread | raw e-mail
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. -Jinhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6384c7bf-e66f-4baf-8b23-0e3b16e1a7f9>
