我有一个像这样的脚本
#!/bin/bash
for i in {1..xx};do break="$i"
If....; then Some command
else break;fi
done
Run Code Online (Sandbox Code Playgroud)
我需要一些可以通过增加 $i 来重复此脚本 n 次的东西。
我试过这个:
For (( ; ; )); do i=1 && echo $i && ((i++));done
Run Code Online (Sandbox Code Playgroud)
但这始终显示 1,而不是递增的数字。我也尝试过$((i+=1))。
那里xx一定是无穷无尽的。
哪里break="$i"给了我重复脚本多少次。