Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] proc.5: use "pwd -P" for printing cwd
@ 2020-07-20  6:12 Jakub Wilk
  2020-07-20  9:36 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Wilk @ 2020-07-20  6:12 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man

"/bin/pwd" happens to work with the GNU coreutils implementation, which
has -P as the default, contrary to POSIX requirements.

Use "pwd -P" instead, which is shorter, easier to type, and should work
everywhere.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
---
 man5/proc.5 | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/man5/proc.5 b/man5/proc.5
index 0dbc05228..55f425dcd 100644
--- a/man5/proc.5
+++ b/man5/proc.5
@@ -588,19 +588,10 @@ for instance, you can do this:
 .IP
 .in +4n
 .EX
-.RB "$" " cd /proc/20/cwd; /bin/pwd"
+.RB "$" " cd /proc/20/cwd; pwd \-P"
 .EE
 .in
 .IP
-Note that the
-.I pwd
-command is often a shell built-in, and might
-not work properly.
-In
-.BR bash (1),
-you may use
-.IR "pwd\ \-P" .
-.IP
 .\" The following was still true as at kernel 2.6.13
 In a multithreaded process, the contents of this symbolic link
 are not available if the main thread has already terminated
-- 
2.28.0.rc1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] proc.5: use "pwd -P" for printing cwd
  2020-07-20  6:12 [PATCH] proc.5: use "pwd -P" for printing cwd Jakub Wilk
@ 2020-07-20  9:36 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-07-20  9:36 UTC (permalink / raw)
  To: Jakub Wilk; +Cc: mtk.manpages, linux-man

Hello Jakub,

On 7/20/20 8:12 AM, Jakub Wilk wrote:
> "/bin/pwd" happens to work with the GNU coreutils implementation, which
> has -P as the default, contrary to POSIX requirements.
> 
> Use "pwd -P" instead, which is shorter, easier to type, and should work
> everywhere.

Nice catch! Thanks. Patch applied.

Cheers,

Michael

> Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
> ---
>  man5/proc.5 | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/man5/proc.5 b/man5/proc.5
> index 0dbc05228..55f425dcd 100644
> --- a/man5/proc.5
> +++ b/man5/proc.5
> @@ -588,19 +588,10 @@ for instance, you can do this:
>  .IP
>  .in +4n
>  .EX
> -.RB "$" " cd /proc/20/cwd; /bin/pwd"
> +.RB "$" " cd /proc/20/cwd; pwd \-P"
>  .EE
>  .in
>  .IP
> -Note that the
> -.I pwd
> -command is often a shell built-in, and might
> -not work properly.
> -In
> -.BR bash (1),
> -you may use
> -.IR "pwd\ \-P" .
> -.IP
>  .\" The following was still true as at kernel 2.6.13
>  In a multithreaded process, the contents of this symbolic link
>  are not available if the main thread has already terminated
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20  6:12 [PATCH] proc.5: use "pwd -P" for printing cwd Jakub Wilk
2020-07-20  9:36 ` Michael Kerrisk (man-pages)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git