摘要:
1、测试1 [root@centos7 test2]# i=0 [root@centos7 test2]# max=5 [root@centos7 test2]# while((i<max));do echo $i;((i++));done 0 1 2 3 4 阅读全文
摘要:
1、测试1 [root@centos7 test2]# for ((i=1; i<=5; i++)); do echo "100"; done 100 100 100 100 100 阅读全文
摘要:
1、测试1 [root@centos7 test2]# cat test.sh #!/bin/bash read -p "please input an character: " i case $i in [a-z]|[A-Z]) echo "letter!" ;; [0-9]) echo "num 阅读全文
摘要:
1、隐藏光标 echo -e "\033[?25l" 2、显示光标 echo -e "\033[?25h" 来源:https://blog.csdn.net/weixin_43336281/article/details/99109789 阅读全文
摘要:
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 阅读全文
摘要:
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] 阅读全文
摘要:
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 阅读全文