for1.0 revision 200193
1199282Sjilles# $FreeBSD: head/tools/regression/bin/sh/parser/for1.0 200193 2009-12-06 23:31:23Z jilles $ 2199282Sjilles 3199282Sjillesnl=' 4199282Sjilles' 5199282Sjilleslist=' a b c' 6199282Sjillesfor s1 in "$nl" " "; do 7200193Sjilles for s2 in "$nl" ";" ";$nl"; do 8199282Sjilles for s3 in "$nl" " "; do 9199282Sjilles r='' 10199282Sjilles eval "for i${s1}in ${list}${s2}do${s3}r=\"\$r \$i\"; done" 11199282Sjilles [ "$r" = "$list" ] || exit 1 12199282Sjilles done 13199282Sjilles done 14199282Sjillesdone 15199282Sjillesset -- $list 16200193Sjillesfor s2 in "$nl" " " ";" ";$nl"; do # s2=";" and ";$nl" are extensions to POSIX 17199282Sjilles for s3 in "$nl" " "; do 18199282Sjilles r='' 19199282Sjilles eval "for i${s2}do${s3}r=\"\$r \$i\"; done" 20199282Sjilles [ "$r" = "$list" ] || exit 1 21199282Sjilles done 22199282Sjillesdone 23199282Sjillesfor s1 in "$nl" " "; do 24200193Sjilles for s2 in "$nl" ";" ";$nl"; do 25199282Sjilles for s3 in "$nl" " "; do 26199282Sjilles eval "for i${s1}in${s2}do${s3}exit 1; done" 27199282Sjilles done 28199282Sjilles done 29199282Sjillesdone 30