[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Getopt
is used to break up command line options for
subsequent parsing.
The only mandatory argument, optstring is a list of short (one-character) options to be recognized. Each short option character in optstring may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument. <FIXME> Document starting `+' and `-' chars. </>
Each subsequent invocation of getopt
processes next command
line argument. Getopt
returns true if the argument is an
option and returns false otherwise. It stores the retrieved option
(always with a leading dash) in the variable opt (OPTVAR
by default). If the option has an argument, the latter is stored
in the variable arg (OPTARG
by default). Index of the
next command line argument to be processed is preserved in the
variable ind (OPTIND
by default).
The usual way of processing command line options is by invoking
getopt
in a condition expression of while
loop and
analyzing its return values within the loop. For example:
while getopt "hf:" case $OPTVAR in "-h") print "Got -h option\n" "-f") print "Got -f option. Argument is " $OPTARG "\n" ".*") begin print "Unknown option: " $OPTVAR "\n" exit 1 end end end |
If expr is given, name must also be present.
If name is not given, variable INPUT is used by default.
radtest
command line options. Options should
be a valid radtest
command line (see section 13.2.1 Invoking radtest).
$2
becomes
$1
, $3
becomes $2
etc. $#
is decremented.
$0
is not affected.
If expr is given, it is evaluated, converted to integer and
used as shift value. Thus shift 2
shifts all positional
parameters left by 2.
It is an error to use return
outside of a function definition.
See section 13.2.10 Loops, for the detailed discussion of the subject.
See section 13.2.10 Loops, for the detailed discussion of the subject.
REPLY_CODE
and reply A/V pairs in
the variable REPLY
(see section 13.2.8 Interacting with Radius Servers).
flags are a whitespace-separated list of variable assignments. Following variables are understood:
repeat=n
id=n
keepauth=1
avlist
, or an immediate
avlist
(see section 13.2.2.3 Lists of A/V pairs). In the latter case, the parentheses
around the list are optional.
REPLY_CODE
matches code and, optionally, if
REPLY
matches expr-or-pair-list. If so, print the
string `PASS', otherwise print `FAIL'.
See section 13.2.8 Interacting with Radius Servers, for the detailed discussion of this statement.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |