]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/posixexp3.sub
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / posixexp3.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#
d233b485
CR
14set -- 1 2
15
16unset var
17recho ${var-$@}
18recho ${var-"$@"}
19recho ${var-$*}
20recho ${var-"$*"}
21
22unset -v a b c d
23recho ${a=$@}
24recho "$a"
25recho ${b="$@"}
26recho "$b"
27recho ${c=$*}
28recho "$c"
29recho ${d="$*"}
30recho "$d"
31
32IFS=
33unset var
34recho ${var-$@}
35recho ${var-"$@"}
36recho ${var-$*}
37recho ${var-"$*"}
38
39unset -v a b c d
40# Posix interp 221
41# there should never be any word splitting because IFS is null
42recho ${a=$@}
43recho "$a"
44recho $a
45recho ${b="$@"}
46recho "$b"
47recho $b
48recho ${c=$*}
49recho "$c"
50recho $c
51recho ${d="$*"}
52recho "$d"
53recho $d
54
55unset -v a b c d
56a=$@
57recho $a
58b="$@"
59recho $b
60c=$*
61recho $c
62d="$*"
63recho $d
64
65unset -v parameter a b c d