]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/dollar-at-star4.sub
Bash-4.4 patch 19
[thirdparty/bash.git] / tests / dollar-at-star4.sub
CommitLineData
a0c0a00f
CR
1# tests for quoted and unquoted, split and unsplit expansions of $@ and $*
2# Posix interpretation 221 speaks to this issue
3
4set -- a b
5IFS=
6x=abc
7
8printf "<%s>\n" ${x#$*}
9
10a="a bc"
11echo ${a#$*}
12unset x a
13
14a=$@
15echo "$a"
16
17a=$*
18echo "$a"
19
20printf '<%s>' $@ ; echo
21
22IFS='
23'
24
25a=$@
26echo "$a"
27
28a=$*
29echo "$a"
30
31unset a
32
33unset IFS
34set a b "c d"
35printf '<%s>' $* ; echo
36
37IFS=
38set a b "c d"
39printf '<%s>' $* ; echo
40
41IFS=:
42set a b
43printf '<%s>' ${foo=$*} ; echo
44printf '<%s>' "${foo}" ; echo
45
46unset foo
47IFS='
48'
49printf '<%s>' ${foo=$@} ; echo
50printf '<%s>' "$foo" ; echo
51
52IFS=?
53set a c
54foo=abcd
55
56echo ${foo#"$*"}
57echo "${foo#$*}"
58
59echo "${foo#'a?c'}"
60echo "${foo#a?c}"
61
62IFS=?
63set a c
64str=a$'\001'c
65pat=a$'\001'
66echo "${str#$pat}"
67
68set a b
69IFS=:
70
71a=$@
72recho "$a"
73
74recho ${foo=$*}
75recho "$foo"
76
77unset foo
78IFS='
79'
80recho ${foo=$@}
81recho "$foo"
82
83shift $#
84unset foo x
85
86set -- a b
87x=abc
88
89IFS=
90printf "<%s>\n" ${x#$*}
91printf "<%s>\n" "${x#$*}"
92
93x=abcd
94set a c
95IFS='?'
96printf "<%s>\n" ${x#$*}
97printf "<%s>\n" "${x#$*}"