19
12/11
15个精典SHELL编程例子
1.输出 1 1 2 1 2 3 1 #!/bin/bash 2 echo "Please type your number:" 3 read a 4 for ((i=1;i<=a;i++)) 5 do 6 for ((p=1;p<=i;p++)) 7 do 8 echo -n " $p " 9 done 10 echo 11 done 12 echo 2.九九乘法表 1 #!/bin/bash 2 for ((i=1;i<10;i++)) 3 do 4 for ((p=1;p<=i;p++)) 5 do 6 echo -ne " $p x $i= "`expr $i \* $p` 7 ...