]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/case1.sub
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / case1.sub
CommitLineData
8868edaf
CR
1# This program is free software: you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation, either version 3 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program. If not, see <http://www.gnu.org/licenses/>.
13#
ac50fbac
CR
14x='\x'
15
16case x in
17\x) echo ok 1;;
18*) echo bad 1;;
19esac
20
21case x in
22$x) echo ok 2;;
23*) echo bad 2;;
24esac
25
26case $x in
27\x) echo bad 3;;
28\\x) echo ok 3 ;;
29*) echo bad 3.1 ;;
30esac
31
32case $x in
33\\$x) echo ok 4 ;;
34x) echo bad 4;;
35$x) echo bad 4.1 ;;
36*) echo bad 4.2;;
37esac
38
39case x in
40\\x) echo bad 5;;
41\x) echo ok 5;;
42*) echo bad 5.1;;
43esac
44
45case x in
46\\x) echo bad 6;;
47x) echo ok 6;;
48*) echo bad 6.1;;
49esac
50
51case x in
52$x) echo ok 7 ;;
53\\$x) echo bad 7 ;;
54*) echo bad 7.1 ;;
55esac
56
57case x in
58\x) echo ok 8 ;;
59\\x) echo bad 8 ;;
60*) echo bad 8.1 ;;
61esac
62
63case \x in
64\x) echo ok 9 ;;
65\\x) echo bad 9 ;;
66*) echo bad 9.1 ;;
67esac
68
69case $x in
70$x) echo oops 1 ;;
71*) echo mysterious 1 ;;
72esac
73
74case \x in
75\x) echo mysterious 2 ;;
76*) echo oops 2 ;;
77esac