ubuntu中实现循环的示例:
1.直接用bash解释脚本,如:“bash ./xxx”
2.脚本例如:
#!/bin/bash
#这样就直接指定bash解释
read n
total=0
for((i=2;i<=$n;i+=2));do
total=$(($total+$i))
done
echo "2+...+n=$total"
echo ========================
for((i=0;i<10;i++))
do
for((j=0;jdo
echo -n "2"
done
done