Mike Frysinger | d690f68 | 2009-03-30 06:50:54 +0000 | [diff] [blame] | 1 | # check invalid options are rejected |
Denys Vlasenko | b28d4c3 | 2017-07-25 16:29:36 +0200 | [diff] [blame] | 2 | # bash: in posix mode, aborts if non-interactive |
Mike Frysinger | d690f68 | 2009-03-30 06:50:54 +0000 | [diff] [blame] | 3 | unset - |
| 4 | echo $? |
| 5 | unset -m a b c |
| 6 | echo $? |
| 7 | |
| 8 | # check funky usage |
| 9 | unset |
| 10 | echo $? |
| 11 | |
| 12 | # check normal usage |
| 13 | echo ___ |
| 14 | f=f g=g |
| 15 | echo $? $f $g |
| 16 | unset f |
| 17 | echo $? $f $g |
| 18 | unset g |
| 19 | echo $? $f $g |
| 20 | |
| 21 | echo ___ |
| 22 | f=f g=g |
| 23 | echo $? $f $g |
| 24 | unset f g |
| 25 | echo $? $f $g |
| 26 | f=f g=g |
| 27 | echo $? $f $g |
| 28 | unset -v f g |
| 29 | echo $? $f $g |
| 30 | |
| 31 | # check read only vars |
| 32 | echo ___ |
| 33 | f=f g=g |
Denys Vlasenko | b28d4c3 | 2017-07-25 16:29:36 +0200 | [diff] [blame] | 34 | VAR_RO=1 |
| 35 | readonly VAR_RO |
| 36 | unset VAR_RO |
Mike Frysinger | d690f68 | 2009-03-30 06:50:54 +0000 | [diff] [blame] | 37 | echo $? $f $g |
Denys Vlasenko | b28d4c3 | 2017-07-25 16:29:36 +0200 | [diff] [blame] | 38 | unset f VAR_RO g |
Mike Frysinger | d690f68 | 2009-03-30 06:50:54 +0000 | [diff] [blame] | 39 | echo $? $f $g |