All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] read.1p: Split format and argument of printf call
@ 2023-03-02 22:19 elmono
  0 siblings, 0 replies; 2+ messages in thread
From: elmono @ 2023-03-02 22:19 UTC (permalink / raw)
  To: linux-man, Alejandro Colomar, Michael Kerrisk

As printf expects the format and arguments as separate arguments, split
the string accordingly. This is already fixed in the HTML version of the
standard.
---
 man-pages-posix-2017/man1p/read.1p | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man-pages-posix-2017/man1p/read.1p b/man-pages-posix-2017/man1p/read.1p
index e09b896..d7e3a0a 100644
--- a/man-pages-posix-2017/man1p/read.1p
+++ b/man-pages-posix-2017/man1p/read.1p
@@ -196,7 +196,7 @@ The following command:
 
 while read -r xx yy
 do
-    printf "%s %s\en$yy$xx"
+    printf "%s %s\en" "$yy" "$xx"
 done < \fIinput_file\fR
 .fi
 .P
-- 
2.39.1

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

* Re: [patch] read.1p: Split format and argument of printf call
       [not found] ` <c9684666-8915-42fe-c44b-2d90c18f71e0@yahoo.de>
@ 2023-03-06 12:41   ` Alejandro Colomar
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2023-03-06 12:41 UTC (permalink / raw)
  To: Florian Loth, linux-man, elmono


[-- Attachment #1.1: Type: text/plain, Size: 869 bytes --]

Hi Florian,

On 3/2/23 23:05, Florian Loth wrote:
> As printf expects the format and arguments as separate arguments, split
> the string accordingly. This is already fixed in the HTML version of the
> standard.
Patch applied.

Thanks,

Alex
> ---
>  man-pages-posix-2017/man1p/read.1p | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man-pages-posix-2017/man1p/read.1p b/man-pages-posix-2017/man1p/read.1p
> index e09b896..d7e3a0a 100644
> --- a/man-pages-posix-2017/man1p/read.1p
> +++ b/man-pages-posix-2017/man1p/read.1p
> @@ -196,7 +196,7 @@ The following command:
>  
>  while read -r xx yy
>  do
> -    printf "%s %s\en$yy$xx"
> +    printf "%s %s\en" "$yy" "$xx"
>  done < \fIinput_file\fR
>  .fi
>  .P

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2023-03-06 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 22:19 [patch] read.1p: Split format and argument of printf call elmono
     [not found] <c9684666-8915-42fe-c44b-2d90c18f71e0.ref@yahoo.de>
     [not found] ` <c9684666-8915-42fe-c44b-2d90c18f71e0@yahoo.de>
2023-03-06 12:41   ` Alejandro Colomar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.