projects
/
oweals
/
busybox.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
hush: fix false positive in unset.tests
[oweals/busybox.git]
/
shell
/
hush_test
/
hush-vars
/
unset.tests
1
(
2
3
# check invalid options are rejected
4
# bash: in posix mode, aborts if non-interactive
5
unset -
6
echo $?
7
unset -m a b c
8
echo $?
9
10
# check funky usage
11
unset
12
echo $?
13
14
# check normal usage
15
echo ___
16
f=f g=g
17
echo $? $f $g
18
unset f
19
echo $? $f $g
20
unset g
21
echo $? $f $g
22
23
echo ___
24
f=f g=g
25
echo $? $f $g
26
unset f g
27
echo $? $f $g
28
f=f g=g
29
echo $? $f $g
30
unset -v f g
31
echo $? $f $g
32
33
# check read only vars
34
echo ___
35
f=f g=g
36
VAR_RO=1
37
readonly VAR_RO
38
unset VAR_RO
39
echo $? $f $g
40
unset f VAR_RO g
41
echo $? $f $g
42
43
) 2>&1 \
44
| sed -e 's/ unrecognized option: / invalid option -- /' \
45
-e 's/ illegal option -- / invalid option -- /' \