Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15367 > unrolled thread

Wrong explanation of getopts

Started byRoland Illig <roland.illig@gmx.de>
First post2019-09-15 21:57 +0200
Last post2019-09-15 21:57 +0200
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Wrong explanation of getopts Roland Illig <roland.illig@gmx.de> - 2019-09-15 21:57 +0200

#15367 — Wrong explanation of getopts

FromRoland Illig <roland.illig@gmx.de>
Date2019-09-15 21:57 +0200
SubjectWrong explanation of getopts
Message-ID<mailman.301.1568577474.2190.bug-bash@gnu.org>
The help text of getopts says:

>   Getopts normally parses the positional parameters ($0 - $9), but if
>   more arguments are given, they are parsed instead.

The positional parameter $0 (is it even called that way) is not parsed
by getopts. Its only use might be in error messages, but I'm not sure
about it.

The "instead" in "they are parsed instead" is totally wrong. $1 to $9
are always parsed, no matter if there are more than 10 positional
parameters or not.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web