摘要:
break continue exit break 结束本次for循环写个for循环脚本vim for2.sh#!/bin/bash##for i in `seq 1 5`do echo $iif [ $i -eq 4 ]then breakfiecho $idone... 阅读全文
摘要:
while 死循环vim while.sh#!/bin/bash##while :do date +%T sleep 3done: 永久帧查看时间3秒循环1次打印1-10#!/bin/bash##n=1while [ $n -le 10 ]do echo $n n=$[$n+... 阅读全文
摘要:
产生序列的命令seq 1 101 2 3 4 5 6 7 8 9 10seq 1 2 101 3 5 7 9 (从1开始增加2显示这个数字,到10结束)seq 10 -2 110 8 6 4 2seq 10 -1 110 9 8 7 6 5 4 3 2 1seq -w 1 1001 02 03 04... 阅读全文
摘要:
逻辑判断的格式vim case.sh#!/bin/bashread -p "please input a number:" nm=$[$n%2]case $m in 1) echo " It is a jishu'" ;; ... 阅读全文