//while循环:注意点确保循环会自己终止;
int $test_int = 3;
while ($test_int < 100)//while循环;
{
$test_int = $test_int * 3;
print ("$test_int is equal to " + $test_int +"\n");
}
//for in 循环:
string $selectedList[] = `ls -sl`;//"ls -sl"该命令列出所有的被选中对象;
string $currentObject;
for ($currentObject in $selectedList)//把$selectedList数组里的每个对象运行一遍,将那个数组条目存入变量$currentObject;
{
print ("You've selected " + $currentObject + "\n");
}
//for循环:
int $counter;
for ($counter = 0;$counter < 100;$counter++)
{
print ($counter + "\n");//<code>
}
//