用上 whil for if 打印出 100以内的质数
#!/bin/bash
#author Alvin
#version 1.0.0
#test for 1-100 zhishu
a=2
while [ $a -le 100 ];
do
z=1
for (( j = 2;$j < $a;j++ ));do
if [ $(($a%$j)) -eq 0 ];then
z=0
break
fi
done
if [ $z -eq 1 ];then
echo -ne $a "\t"
fi
let a+=1
done
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97