Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.misc > #66679
| From | Lawrence D'Oliveiro <ldo@nz.invalid> |
|---|---|
| Newsgroups | comp.os.linux.misc |
| Subject | Re: Useless Use Of Regexes |
| Date | 2025-03-27 21:05 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <vs4eja$14bph$1@dont-email.me> (permalink) |
| References | (8 earlier) <vs1ou7$9qn3$1@news1.tnib.de> <vs23sj$2s4s3$1@dont-email.me> <vs2suo$cka4$1@news1.tnib.de> <vs2ugt$3nl2p$1@dont-email.me> <vs3s5l$f45n$1@news1.tnib.de> |
On Thu, 27 Mar 2025 16:51:16 +0100, Marc Haber wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>>On Thu, 27 Mar 2025 07:58:32 +0100, Marc Haber wrote:
>>
>>> You could have it easier with getopt ...
>>
>>Last I checked, getopt doesn’t do long options.
>
> You should check again.
ldo@theon:~> help getopt
getopts: getopts optstring name [arg ...]
Parse option arguments.
Getopts is used by shell procedures to parse positional parameters
as options.
OPTSTRING contains the option letters to be recognized; if a letter
is followed by a colon, the option is expected to have an argument,
which should be separated from it by white space.
Each time it is invoked, getopts will place the next option in the
shell variable $name, initializing name if it does not exist, and
the index of the next argument to be processed into the shell
variable OPTIND. OPTIND is initialized to 1 each time the shell or
a shell script is invoked. When an option requires an argument,
getopts places that argument into the shell variable OPTARG.
getopts reports errors in one of two ways. If the first character
of OPTSTRING is a colon, getopts uses silent error reporting. In
this mode, no error messages are printed. If an invalid option is
seen, getopts places the option character found into OPTARG. If a
required argument is not found, getopts places a ':' into NAME and
sets OPTARG to the option character found. If getopts is not in
silent mode, and an invalid option is seen, getopts places '?' into
NAME and unsets OPTARG. If a required argument is not found, a '?'
is placed in NAME, OPTARG is unset, and a diagnostic message is
printed.
If the shell variable OPTERR has the value 0, getopts disables the
printing of error messages, even if the first character of
OPTSTRING is not a colon. OPTERR has the value 1 by default.
Getopts normally parses the positional parameters, but if arguments
are supplied as ARG values, they are parsed instead.
Exit Status:
Returns success if an option is found; fails if the end of options is
encountered or an error occurs.
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar
Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-24 20:34 +0000
Re: Useless Use Of Regexes Pancho <Pancho.Jones@protonmail.com> - 2025-03-24 21:48 +0000
Re: Useless Use Of Regexes The Natural Philosopher <tnp@invalid.invalid> - 2025-03-24 22:57 +0000
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-24 22:59 +0000
Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-25 08:30 +0100
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 00:35 +0000
Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-26 08:20 +0100
Re: Useless Use Of Regexes Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2025-03-25 11:09 +0200
Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-25 13:03 +0100
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 00:42 +0000
Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-26 08:21 +0100
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 19:45 +0000
Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-26 21:43 +0100
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-26 23:50 +0000
Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-27 07:58 +0100
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-27 07:25 +0000
Re: Useless Use Of Regexes Marc Haber <mh+usenetspam1118@zugschl.us> - 2025-03-27 16:51 +0100
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-27 21:05 +0000
Re: Useless Use Of Regexes marrgol <marrgol@address.invalid> - 2025-03-28 12:21 +0100
Re: Useless Use Of Regexes Chris Ahlstrom <OFeem1987@teleworm.us> - 2025-03-28 11:42 -0400
Re: Useless Use Of Regexes rbowman <bowman@montana.com> - 2025-03-28 18:46 +0000
Re: Useless Use Of Regexes Chris Ahlstrom <OFeem1987@teleworm.us> - 2025-03-29 11:40 -0400
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-28 20:25 +0000
Re: Useless Use Of Regexes Wayne <wayne@nospam.invalid> - 2025-03-31 23:54 -0400
Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-03-27 04:08 -0400
Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-03-26 00:47 -0400
Re: Useless Use Of Regexes rbowman <bowman@montana.com> - 2025-03-26 16:51 +0000
Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-03-27 03:13 -0400
Re: Useless Use Of Regexes Pancho <Pancho.Jones@protonmail.com> - 2025-03-25 12:08 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-03-30 14:04 +0000
Re: Useless Use Of Regexes Ben Collver <bencollver@tilde.pink> - 2025-03-25 15:29 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-03-30 14:02 +0000
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-30 21:15 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-03-30 22:04 +0000
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-31 01:26 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-06 08:40 +0000
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-07 21:39 +0000
Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-04-07 21:00 -0400
Re: Useless Use Of Regexes Eli the Bearded <*@eli.users.panix.com> - 2025-04-08 02:05 +0000
Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-04-07 22:06 -0400
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-08 05:49 +0000
Re: Useless Use Of Regexes Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2025-04-08 15:39 +0300
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-09 01:16 +0000
Re: Useless Use Of Regexes c186282 <c186282@nnada.net> - 2025-04-08 22:32 -0400
Shell command history (was: Useless Use Of Regexes) Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2025-04-09 13:26 +0100
Re: Shell command history (was: Useless Use Of Regexes) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-12 06:55 +0000
Re: Shell command history (was: Useless Use Of Regexes) Eli the Bearded <*@eli.users.panix.com> - 2025-04-12 23:55 +0000
Re: Shell command history Nuno Silva <nunojsilva@invalid.invalid> - 2025-04-14 09:47 +0100
Re: Shell command history Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-14 22:37 +0000
Re: Shell command history Eli the Bearded <*@eli.users.panix.com> - 2025-04-15 23:28 +0000
Re: Shell command history Andreas Eder <a_eder_muc@web.de> - 2025-04-16 10:09 +0200
Re: Shell command history Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-16 21:33 +0000
Re: Shell command history Eli the Bearded <*@eli.users.panix.com> - 2025-04-18 04:22 +0000
Re: Shell command history Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-19 22:34 +0000
Re: Shell command history Eli the Bearded <*@eli.users.panix.com> - 2025-04-20 18:26 +0000
Re: Shell command history Nuno Silva <nunojsilva@invalid.invalid> - 2025-04-18 10:31 +0100
Re: Useless Use Of Regexes Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2025-04-09 10:53 +0300
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-12 06:55 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-12 13:07 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-12 11:23 +0000
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-13 04:54 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-13 18:25 +0000
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-14 22:39 +0000
Re: Useless Use Of Regexes Stéphane CARPENTIER <sc@fiat-linux.fr> - 2025-04-17 19:44 +0000
Re: Useless Use Of Regexes Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-18 02:18 +0000
Re: Useless Use Of Regexes candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-04-13 19:00 +0000
csiph-web