If you like BoxMatrix then please contribute Supportdata, Supportdata2, Firmware and/or Hardware (get in touch).
My metamonk@yahoo.com is not reachable by me since years. Please use hippie2000@webnmail.de instead.

0
U

Property:getopts (bashcmd)

From BoxMatrix


BoxMatrix >> Shell-Commands >> getopts (bashcmd) @ BoxMatrix   -   IRC-Chat   -   Translate: de es fr it nl pl
News Selectors Models Accessories Components Environment Config Commands System Webif Software Develop Lexicon Community Project Media

Startup-Scr Hotplug-Scr BusyBox-Cmds Bash-Cmds AVM-Cmds Chipset-Cmds Linux-Cmds Shared-Libs Kernel-Mods Research

Info
  
Name-Collision - multiple objects in this wiki use the name getopts!
getopts (bashcmd) Parse option arguments.
getopts (bbcmd) Parse commandline options.

Bash-Command

Goto:   GPL-Browser  -  Dependencies   -   Model-Matrix   -   Symbols   -   SMW-Browser

Details

Excerpt from:   Bash source   >>   getopts command

Possible #if / #endif blocks are compile options. There is no mechanism yet on BoxMatrix to detect which of these are set per model.

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 ($0 - $9), but if
more arguments are given, 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.

Excerpt from:   bashref.info   >>   Bourne Shell Builtins   >>   getopts command

getopts OPTSTRING NAME [ARGS]

'getopts' is used by shell scripts to parse positional parameters.
OPTSTRING contains the option characters to be recognized; if a
character is followed by a colon, the option is expected to have an
argument, which should be separated from it by whitespace.  The
colon (':') and question mark ('?') may not be used as option
characters.  Each time it is invoked, 'getopts' places 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
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 variable
'OPTARG'.  The shell does not reset 'OPTIND' automatically; it must
be manually reset between multiple calls to 'getopts' within the
same shell invocation if a new set of parameters is to be used.

When the end of options is encountered, 'getopts' exits with a
return value greater than zero.  'OPTIND' is set to the index of
the first non-option argument, and NAME is set to '?'.

'getopts' normally parses the positional parameters, but if more
arguments are given in ARGS, 'getopts' parses those instead.

'getopts' can report errors in two ways.  If the first character of
OPTSTRING is a colon, SILENT error reporting is used.  In normal
operation, diagnostic messages are printed when invalid options or
missing option arguments are encountered.  If the variable 'OPTERR'
is set to 0, no error messages will be displayed, even if the first
character of 'optstring' is not a colon.

If an invalid option is seen, 'getopts' places '?' into NAME and,
if not silent, prints an error message and unsets 'OPTARG'.  If
'getopts' is silent, the option character found is placed in
'OPTARG' and no diagnostic message is printed.

If a required argument is not found, and 'getopts' is not silent, a
question mark ('?') is placed in NAME, 'OPTARG' is unset, and a
diagnostic message is printed.  If 'getopts' is silent, then a
colon (':') is placed in NAME and 'OPTARG' is set to the option
character found.

GPL-Browser

Daily updated index of all getopts code findings on the GPL-Browser. Last update: 2024-12-23 05:02 GMT.
The Browse column points to the Path containing the respective source code on the gpl.boxmatrix.info service.
The SoC column lists the Chip-Codenames, the Model column lists the nicks of the Box-Models.
The Diff column links the comparison of the AVM Kernel to the pristine original from Kernel.org.
The Download column links the full tarball the respective directory content is extracted from.
The presence of the source does not mean it fits the respective model and architecture. See the Model-Matrix where it's used.

Dependencies

Daily updated index of all dependencies of this command. Last update: 2024-12-23 07:59 GMT.
A * in the Mod column marks info from Supportdata-Probes, which will always stay incomplete.

Relation Typ Object Mod Firmware Info Origin
0 dependencies for this command

Model-Matrix

Daily updated index of the presence, path and size of this command for each model. Last update: 2024-12-23 05:43 GMT.
Showing all models using this command. Click any column header (click-wait-click) to sort the list by the respective data.
The (main/scrpn/boot/arm/prx/atom/rtl) label in the Model column shows which CPU is meant for Multi-Linux models.
Note that this list is merged from Firmware-Probes of all known AVM firmware for a model, including Recovery.exe and Labor-Files.

Model Firmware Path Size
FRITZ!Box 6591 Cable (atom) 7.04 - 8.00 <bash>
FRITZ!Box 6660 Cable (atom) 7.14 - 8.00 <bash>
FRITZ!Box 6670 Cable (atom) 7.61 - 7.90 <bash>
FRITZ!Box 6690 Cable (atom) 7.28 - 7.90 <bash>
4 models use this command

Symbols

Daily updated index of all symbols of this command. Last update: 2024-12-23 07:59 GMT.

Firmware Symbol
0 symbols for this command

SMW-Browser

Information is currently being retrieved from the backend.