blob: 47cb37f69257492726920a89586563c662194fb0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
IFS='' # testing with only empty IFS
set -- this is a test
printf '|%s|\n' ${1+"$@"}
echo
printf '|%s|\n' "${1+$@}"
echo
printf '|%s|\n' "$@"
echo
printf '|%s|\n' ${1-"$@"}
printf '|%s|\n' "${1-$@}"
echo
: ${foo:="$@"}
printf '|%s|\n' "$foo"
unset foo
: "${foo:=$@}"
printf '|%s|\n' "$foo"
unset foo
printf '|%s|\n' ${foo-"$@"}
printf '|%s|\n' "${foo-$@}"
|