]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/case.tests
bash-4.3-beta overlay
[thirdparty/bash.git] / tests / case.tests
CommitLineData
8943768b
CR
1case foo in
2bar) echo skip ;;
3foo) echo fallthrough ;&
4bax) echo to here ;&
5qux) echo and here;;
6fop) echo but not here;;
7esac
8
9case foobar in
10bar) echo skip ;;
11foo*) echo retest ;;&
12*bar) echo and match ;;&
13qux) echo but not this ;;
14esac
1231ac47
CR
15
16case a in
17a) echo no more clauses;&
18esac
1f6ec1a8
CR
19
20x=0 y=1
21case 1 in
22 $((y=0)) ) ;;
23 $((x=1)) ) ;&
24 $((x=2)) ) echo $x.$y ;;
25esac
26
27unset x
28readonly xx=1
29case 1 in $((xx++)) ) echo hi1 ;; *) echo hi2; esac
30echo ${xx}.$?
1442f67c
CR
31
32# tests of quote removal and pattern matching
33${THIS_SH} ./case1.sub