i-bash/tests/arith-for.right

87 lines
1.1 KiB
Text
Raw Permalink Normal View History

2000-03-17 21:46:59 +00:00
0
1
2
0
1
2
0
1
2
0
2
4
fx is a function
fx ()
{
i=0;
2005-12-07 14:08:12 +00:00
for ((1; i < 3; i++ ))
2000-03-17 21:46:59 +00:00
do
echo $i;
done;
2005-12-07 14:08:12 +00:00
for ((i=0; 1; i++ ))
2000-03-17 21:46:59 +00:00
do
2004-07-27 13:29:18 +00:00
if (( i >= 3 )); then
2000-03-17 21:46:59 +00:00
break;
fi;
echo $i;
done;
2005-12-07 14:08:12 +00:00
for ((i=0; i<3; 1))
2000-03-17 21:46:59 +00:00
do
echo $i;
2004-07-27 13:29:18 +00:00
(( i++ ));
2000-03-17 21:46:59 +00:00
done;
i=0;
2005-12-07 14:08:12 +00:00
for ((1; 1; 1))
2000-03-17 21:46:59 +00:00
do
2004-07-27 13:29:18 +00:00
if (( i > 2 )); then
2000-03-17 21:46:59 +00:00
break;
fi;
echo $i;
2004-07-27 13:29:18 +00:00
(( i++ ));
2000-03-17 21:46:59 +00:00
done;
i=0;
2005-12-07 14:08:12 +00:00
for ((1; 1; 1))
2000-03-17 21:46:59 +00:00
do
2004-07-27 13:29:18 +00:00
if (( i > 2 )); then
2000-03-17 21:46:59 +00:00
break;
fi;
echo $i;
2004-07-27 13:29:18 +00:00
(( i++ ));
2000-03-17 21:46:59 +00:00
done
}
0
1
2
0
1
2
0
1
2
0
1
2
0
1
2
./arith-for.tests: line 77: syntax error: arithmetic expression required
./arith-for.tests: line 77: syntax error: `(( i=0; "i < 3" ))'
2
./arith-for.tests: line 83: syntax error: `;' unexpected
./arith-for.tests: line 83: syntax error: `(( i=0; i < 3; i++; 7 ))'
2
2001-04-06 19:14:31 +00:00
20
20
12345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678
12345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678
4
3
2
1
0
4
3
2
1
0