]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/comsub-posix.tests
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / comsub-posix.tests
CommitLineData
3185942a
JA
1
2# works right
3echo ab$(echo mnop)yz
4# works right
5echo ab$(echo mnop
6)yz
7#
8# works right
9echo $(echo ab
10 )
11# works right
12echo $(
13)
14echo $()
15echo ab$()cd
16
17echo $(case a in (a) echo sh_352.26ax; esac )
18echo $(case a in (a) echo sh_352.26ay; esac)
19
20echo $((echo sh_352.25a);(echo sh_352.25b))
21
22echo $(echo sh_352.27 ')' ")" \)
23 # ) comment
24 )
25
26echo $(
27echo abc # a comment with )
28)
29
30echo $(
31cat <<eof
32here doc with )
33eof
34)
35
36echo $(
37echo ')'
38)
39
40unset x
41x=$(cat <<"EOF"
42bad' syntax
43EOF
44)
45echo "$x"
46unset x
47
48echo $(for f in \); do echo a; done )
49echo $(case a in a) echo sh_352.26a; esac )
50echo $(case a in a) echo sh_352.26a; esac)
51
52echo $(case a in
53 (a) echo sh_352.26
54 ;;
55 esac
56 )
57
58echo $(case a in
59 a) echo sh_352.26
60 ;;
61 esac
62 )
63
64
65echo $(case a in
66 a) echo sh_352.26
67 ;;
68
69
70
71
72
73 esac
74
75 )
76
77echo $(( 4<(2+3) ? 1 : 32))
78
79echo $(cat << end
80sh_352.28 )
81end
82)
83
84echo $(cat <<- end
85sh_352.28 )
86 end
87)
88
89k=$(case x in x) echo k;; esac)
90echo $k
91
92x=$(
93 case $(ls) in
94 example) echo foobix;;
95 esac
96)
97
98echo $( echo ab\
99cd)
100
101echo `echo ab
102cd`
103
104echo `echo ab #xyz
105cd`
106
107echo "$(echo abcde)
108"
109
110recho "$(echo abcde)
111 "
112
113echo $(echo abcde)\
114foo
115
116recho $(echo abcde)\
117 foo
118
119recho "wx$(echo abcde)yz"
120recho "$(echo abcde)"
121
122echo $(cat <<eof
123'
124eof
125)
126
127echo after 1
128
129echo $(cat <<\eof
130'
131eof
132)
133
134echo after 2
135
136echo "$(cat <<\eof
137'
138eof
139)"
140
141echo after 3
142
143echo "$(cat <<\eof
144`
145eof
146)"
147
148echo after 4
149
150echo $(
151cat << ')'
152hello
153)
154)
155
156echo after 5
157
158echo $(cat <<'eof'
159'
160eof
161)
162
163echo after 6
164
165echo $(
166 case x in x) echo x;; esac
167)
168
169echo $(
170 case x in (x) echo x;; esac
171)
172
173echo $(
174 echo 'quoted )'
175)
176
177echo $(
178 echo comment # with )
179)
180
181echo $(
182cat <<\eof
183 here-doc with )
184eof
185)
186
187echo $(
188cat <<\)
189 here-doc terminated with a parenthesis
190)
191)
192
193echo $(
194cat <<\eof
195 ' # or a single back- or doublequote
196eof
197)
198
199${THIS_SH} ./comsub-posix1.sub
200
495aee44
CR
201${THIS_SH} ./comsub-posix2.sub
202
203${THIS_SH} ./comsub-posix3.sub
204
3185942a
JA
205# produced a parse error through bash-4.0-beta2
206: $(echo foo)"
207"
495aee44
CR
208# produced a parse error through bash-4.1
209unset x
210x=$(
211echo yes
212# a comment with " ' \
213)
214echo $x
215unset x
3185942a 216
0001803f
CR
217# fixed after bash-4.0 released
218: $(case a in a) echo ;; # comment
219esac)