我总是自我良好一阵,后来仔细一看,我的水平真是相当烂啊
帖点我写的垃圾脚本,主要是shell里面的运算有好几种方式,今天时间不够了,有时间好好看看书强化下shell,awk和sed
- #read.sh
- #!/bin/bash
- num=$1
- d=$((num * num))
- echo $d
- #square.sh
- #!/bin/bash
- #This is a example3
- int=1
- while test $int -le 10
- do
- sq=$((int * int))
- echo $sq
- int=$((int+1))
- done
- #end
- #!/bin/bash
- mysql -uroot -pyesg -e "select Uin from test.UinTable" > 1.txt
- cat 1.txt | while read num
- do
- if [ $num != "Uin" ]
- then
- ./read.sh $num
- fi
- done
- #end
当然还可以这样写
- #read.sh
- #!/bin/bash
- num=$1
- nua=$2
- let "d=$num * $nua"
- echo $d
- #square.sh
- #!/bin/bash
- #This is a example3
- int=1
- while test $int -le 10
- do
- let "sq = $int * $int"
- echo $sq
- let "int = $int + 1"
- done
这些东西都相当简单,主要是我太菜了,决定每天总结些东西让自己变的强大起来
阅读(826) | 评论(0) | 转发(0) |