while与until循环基本语法

while与until循环基本语法

#!/bin/bash

# demo while

i=1

while [ $i -lt 10 ];do
  echo $i
  (( i++ ))
done

# demo until

i=1

until [ $i -gt 10 ];do
  echo $i
  (( i++ ))
done

当前标题:while与until循环基本语法
当前地址:http://pcwzsj.com/article/gcoegp.html