xref: /freebsd/bin/sh/tests/parser/for1.0 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1
2nl='
3'
4list=' a b c'
5for s1 in "$nl" " "; do
6	for s2 in "$nl" ";" ";$nl"; do
7		for s3 in "$nl" " "; do
8			r=''
9			eval "for i${s1}in ${list}${s2}do${s3}r=\"\$r \$i\"; done"
10			[ "$r" = "$list" ] || exit 1
11		done
12	done
13done
14set -- $list
15for s2 in "$nl" " "; do
16	for s3 in "$nl" " "; do
17		r=''
18		eval "for i${s2}do${s3}r=\"\$r \$i\"; done"
19		[ "$r" = "$list" ] || exit 1
20	done
21done
22for s1 in "$nl" " "; do
23	for s2 in "$nl" ";" ";$nl"; do
24		for s3 in "$nl" " "; do
25			eval "for i${s1}in${s2}do${s3}exit 1; done"
26		done
27	done
28done
29