摘要:
1、测试1 求1-100的和 [root@centos7 test2]# cat test.sh #!/bin/bash sum=0 a=1 while [ $a -le 100 ] do let sum+=$a let a++ done echo "the sum of 1-100 is: $su 阅读全文
posted @ 2021-04-22 15:51
小鲨鱼2018
阅读(1318)
评论(0)
推荐(0)
摘要:
1、for语句 [root@centos7 test2]# cat test.sh #!/bin/bash sum=0 for i in `seq $1` do let sum+=$i done echo "the sum of 1-$1 is: $sum" [root@centos7 test2] 阅读全文
posted @ 2021-04-22 13:05
小鲨鱼2018
阅读(3998)
评论(0)
推荐(0)
摘要:
1、测试1 [root@centos7 test2]# ls a.txt [root@centos7 test2]# if [ -e a.txt ]; then echo "exist";else echo "no nxist"; fi exist [root@centos7 test2]# if 阅读全文
posted @ 2021-04-22 12:35
小鲨鱼2018
阅读(295)
评论(2)
推荐(0)