linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Error in getopts(1p)
@ 2021-08-04  9:40 Štěpán Němec
  2021-08-04 10:49 ` [PATCH] man-pages-posix-2017/man1p/getopts.1p: Fix usage of printf(1) in example Alejandro Colomar
  0 siblings, 1 reply; 2+ messages in thread
From: Štěpán Němec @ 2021-08-04  9:40 UTC (permalink / raw)
  To: Michael Kerrisk, Alejandro Colomar; +Cc: linux-man


  Hello,

there is an error at the end of the example:

  printf "Remaining arguments are: %s\n$*"

should be

  printf "Remaining arguments are: %s\n" "$*"

(cf.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/getopts.html )

I would have sent a patch, but couldn't find the POSIX man page sources.
Are they available somewhere?

  Thanks,

  Štěpán

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

* [PATCH] man-pages-posix-2017/man1p/getopts.1p: Fix usage of printf(1) in example
  2021-08-04  9:40 Error in getopts(1p) Štěpán Němec
@ 2021-08-04 10:49 ` Alejandro Colomar
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2021-08-04 10:49 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Alejandro Colomar, linux-man, Štěpán Němec

The original HTML files are correct, so this seems a bug in the
conversion.  For now, let's fix the page.

Reported-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---

Hi, Štěpán!

You can check the source code here:
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages-posix.git/>

It's autogenerated from the original HTML POSIX pages, so we should
fix the python script.  But here's the fix you proposed.

Thanks,

Alex


 man-pages-posix-2017/man1p/getopts.1p | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man-pages-posix-2017/man1p/getopts.1p b/man-pages-posix-2017/man1p/getopts.1p
index 6651993..616db6f 100644
--- a/man-pages-posix-2017/man1p/getopts.1p
+++ b/man-pages-posix-2017/man1p/getopts.1p
@@ -337,7 +337,7 @@ if [ ! -z "$bflag" ]; then
     printf \(aqOption -b "%s" specified\en\(aq "$bval"
 fi
 shift $(($OPTIND - 1))
-printf "Remaining arguments are: %s\en$*"
+printf "Remaining arguments are: %s\en" "$*"
 .fi
 .P
 .RE
-- 
2.32.0


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

end of thread, other threads:[~2021-08-04 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04  9:40 Error in getopts(1p) Štěpán Němec
2021-08-04 10:49 ` [PATCH] man-pages-posix-2017/man1p/getopts.1p: Fix usage of printf(1) in example Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).