for1.0 revision 199282
1199282Sjilles# $FreeBSD: head/tools/regression/bin/sh/parser/for1.0 199282 2009-11-14 22:08:32Z jilles $ 2199282Sjilles 3199282Sjillesnl=' 4199282Sjilles' 5199282Sjilleslist=' a b c' 6199282Sjillesfor s1 in "$nl" " "; do 7199282Sjilles for s2 in "$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 16199282Sjillesfor s2 in "$nl" " " ";"; do # s2=";" is an extension 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 24199282Sjilles for s2 in "$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