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