]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/comsub1.sub
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / comsub1.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#
495aee44
CR
14: $(echo \;)
15
16: $(case a in a) echo ;;# comment
17esac)
18
19: $(case a in a) echo ;; # comment
20esac)
21
22: $(: \;# not a comment )
23
24: $(: \ # not a comment)
25
26echo $(case a in a) echo \#esac ;;
27esac)
28
29: $(case a in a) : ;#esac ;;
30esac)
31
32: $(case a in a) : ;#esac comment )
33esac)
34
35: $(case a in a) : ;
36esac)
37
38echo $(#comment )
39echo a)
40
41echo $(case a in (a) echo ok 1;; # comment
42esac)
43
44echo $(case a in (a) echo ok 2;; # comment
45(b) echo moo;;
46esac)
47
48echo $(case a in (a) echo ok 3 # comment
49;;
50esac)
51
52echo $(case a in a) echo ok 4;; # comment
53esac)
54
55echo $(case a in a) echo ok 5;; # comment
56b) echo moo;;
57esac)
58
59echo $(case a in (a) echo ok 6 # comment
60;;
61esac)
a0c0a00f
CR
62
63echo $( # we just took and pasted in some
64# code from another script inside a
65# command substitution
66echo xyz
67)
d233b485
CR
68
69# problem with parse_comsub through bash-4.4
70case $(echo $$'x\nx') in
71x*) echo bad 7;;
72*) echo ok 7;;
73esac