summaryrefslogtreecommitdiffhomepage
path: root/tests/zash/trim-all.sh
blob: 1b45bf234b3be2791bc597b4535dba71b6387ea8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# `${@#pat}` and `${*#pat}`: the trim applies to each positional parameter,
# and then the usual `"$@"` / `"$*"` rules decide the fields.  ksh93 and
# bash agree on every line, which is where the expectations come from.
set -- abc abd
printf "<%s>" "${@#ab}"; echo
printf "<%s>" ${@#ab}; echo
printf "<%s>" "${*#ab}"; echo
printf "<%s>" ${*#ab}; echo
printf "<%s>" "${@%c}"; echo
printf "<%s>" "${@%%*d}"; echo
printf "<%s>" "${@##a*b}"; echo
set -- "a b" "a c"
printf "<%s>" "${@#a }"; echo
printf "<%s>" ${@#a\ }; echo
printf "<%s>" "${*% c}"; echo
set --
printf "[%s]" "${@#a}"; echo
set -- one two
IFS=:
printf "<%s>" "${*#o}"; echo