blob: 268323a6df8a2c42458d57ad770baf705eeaee0f [file] [log] [blame]
Denys Vlasenko9fed83a2017-08-29 14:35:58 +02001(
2
Mike Frysingerd690f682009-03-30 06:50:54 +00003# check invalid options are rejected
Denys Vlasenkob28d4c32017-07-25 16:29:36 +02004# bash: in posix mode, aborts if non-interactive
Mike Frysingerd690f682009-03-30 06:50:54 +00005unset -
6echo $?
7unset -m a b c
8echo $?
9
10# check funky usage
11unset
12echo $?
13
14# check normal usage
15echo ___
16f=f g=g
17echo $? $f $g
18unset f
19echo $? $f $g
20unset g
21echo $? $f $g
22
23echo ___
24f=f g=g
25echo $? $f $g
26unset f g
27echo $? $f $g
28f=f g=g
29echo $? $f $g
30unset -v f g
31echo $? $f $g
32
33# check read only vars
34echo ___
35f=f g=g
Denys Vlasenkob28d4c32017-07-25 16:29:36 +020036VAR_RO=1
37readonly VAR_RO
38unset VAR_RO
Mike Frysingerd690f682009-03-30 06:50:54 +000039echo $? $f $g
Denys Vlasenkob28d4c32017-07-25 16:29:36 +020040unset f VAR_RO g
Mike Frysingerd690f682009-03-30 06:50:54 +000041echo $? $f $g
Denys Vlasenko9fed83a2017-08-29 14:35:58 +020042
43) 2>&1 \
44| sed -e 's/ unrecognized option: / invalid option -- /' \
45 -e 's/ illegal option -- / invalid option -- /' \