trim6.0 revision 259210
11553Srgrimes# $FreeBSD: head/bin/sh/tests/expansion/trim6.0 214524 2010-10-29 19:34:57Z jilles $ 21553Srgrimes 31553Srgrimese= 41553Srgrimesfor i in 0 1 2 3; do 51553Srgrimes for j in 0 1 2 3 4 5 6 7; do 61553Srgrimes for k in 0 1 2 3 4 5 6 7; do 71553Srgrimes case $i$j$k in 81553Srgrimes 000) continue ;; 91553Srgrimes esac 101553Srgrimes e="$e\\$i$j$k" 111553Srgrimes done 121553Srgrimes done 131553Srgrimesdone 141553Srgrimese=$(printf "$e") 151553Srgrimesv=@$e@$e@ 161553Srgrimesy=${v##*"$e"} 171553Srgrimesyq="${v##*"$e"}" 181553Srgrimes[ "$y" = @ ] || echo "error when unquoted in non-splitting context" 191553Srgrimes[ "$yq" = @ ] || echo "error when quoted in non-splitting context" 201553Srgrimes[ "${v##*"$e"}" = @ ] || echo "error when quoted in splitting context" 211553SrgrimesIFS= 221553Srgrimes[ ${v##*"$e"} = @ ] || echo "error when unquoted in splitting context" 231553Srgrimes