trim6.0 revision 214524
1218889Sjilles# $FreeBSD: head/tools/regression/bin/sh/expansion/trim6.0 214524 2010-10-29 19:34:57Z jilles $ 2218889Sjilles 3218889Sjillese= 4218889Sjillesfor i in 0 1 2 3; do 5218889Sjilles for j in 0 1 2 3 4 5 6 7; do 6218889Sjilles for k in 0 1 2 3 4 5 6 7; do 7218889Sjilles case $i$j$k in 8218889Sjilles 000) continue ;; 9218889Sjilles esac 10218889Sjilles e="$e\\$i$j$k" 11218889Sjilles done 12218889Sjilles done 13218889Sjillesdone 14218889Sjillese=$(printf "$e") 15218889Sjillesv=@$e@$e@ 16y=${v##*"$e"} 17yq="${v##*"$e"}" 18[ "$y" = @ ] || echo "error when unquoted in non-splitting context" 19[ "$yq" = @ ] || echo "error when quoted in non-splitting context" 20[ "${v##*"$e"}" = @ ] || echo "error when quoted in splitting context" 21IFS= 22[ ${v##*"$e"} = @ ] || echo "error when unquoted in splitting context" 23