]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/getopts.right
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / getopts.right
CommitLineData
8868edaf 1getopts: usage: getopts optstring name [arg ...]
d166f048 22
8868edaf 3getopts: usage: getopts optstring name [arg ...]
d166f048 42
8868edaf
CR
5./getopts.tests: line 23: getopts: -a: invalid option
6getopts: usage: getopts optstring name [arg ...]
d166f048
JA
7-a specified
8-b bval specified
9remaining args: one two three
10-a specified
11-b bval specified
12remaining args: one two three four five six seven eight nine ten eleven twelve
cce855bc
JA
13./getopts1.sub: option requires an argument -- b
14Usage: ./getopts1.sub [-a] [-b value] args
d166f048
JA
15-a specified
16-c cval specified
17-d specified
18-a specified
19-b 3 specified
20remaining args: one two three four five
21-a specified
22-b bval specified
23remaining args: one two three
24-a specified
25-b bval specified
26remaining args: one two three
cce855bc
JA
27./getopts4.sub: error: option `b' requires an argument
28Usage: ./getopts4.sub [-a] [-b value] args
29./getopts4.sub: error: illegal option character `c'
30Usage: ./getopts4.sub [-a] [-b value] args
d166f048
JA
31-a specified
32remaining args: -b bval one two three
33OPTERR=0
34a here
35something else here
36OPTIND=3
37getop: OPTERR=1
38a here
cce855bc 39./getopts5.sub: illegal option -- c
d166f048 40something else here
cce855bc 41./getopts5.sub: illegal option -- d
d166f048 42something else here
cce855bc 43./getopts5.sub: illegal option -- e
d166f048
JA
44something else here
45getop: OPTIND=5
46OPTIND=3
47OPTERR=0
48-a specified
49remaining args:
50-a specified
51remaining args:
52-a specified
53remaining args:
540
8868edaf 55./getopts7.sub: line 17: getopts: `opt-var': not a valid identifier
d166f048 56remaining args:
a0c0a00f
CR
57opt: x
58opt: y
59opt: a
60opt: b
61opt: c
62opt: z
63$1 = a
8868edaf 64./getopts10.sub: line 16: OPTARG: readonly variable
a0c0a00f
CR
65OPTARG = x = ?
66unset x = ?
67declare -r RO="foo"
68declare -r RO="foo"