blob: 81243fbf9450f75d09c64fa85fcfad7fa8c2ebf4 [file] [log] [blame]
Mike Frysingerd690f682009-03-30 06:50:54 +00001# check invalid options are rejected
Denys Vlasenkob28d4c32017-07-25 16:29:36 +02002# bash: in posix mode, aborts if non-interactive
Mike Frysingerd690f682009-03-30 06:50:54 +00003unset -
4echo $?
5unset -m a b c
6echo $?
7
8# check funky usage
9unset
10echo $?
11
12# check normal usage
13echo ___
14f=f g=g
15echo $? $f $g
16unset f
17echo $? $f $g
18unset g
19echo $? $f $g
20
21echo ___
22f=f g=g
23echo $? $f $g
24unset f g
25echo $? $f $g
26f=f g=g
27echo $? $f $g
28unset -v f g
29echo $? $f $g
30
31# check read only vars
32echo ___
33f=f g=g
Denys Vlasenkob28d4c32017-07-25 16:29:36 +020034VAR_RO=1
35readonly VAR_RO
36unset VAR_RO
Mike Frysingerd690f682009-03-30 06:50:54 +000037echo $? $f $g
Denys Vlasenkob28d4c32017-07-25 16:29:36 +020038unset f VAR_RO g
Mike Frysingerd690f682009-03-30 06:50:54 +000039echo $? $f $g