linux-tutorial/codes/shell/demos/statement/until-demo.sh

14 lines
125 B
Bash
Raw Normal View History

2019-03-01 10:36:45 +08:00
#!/usr/bin/env bash
x=0
until [[ ${x} -ge 5 ]]; do
echo ${x}
x=`expr ${x} + 1`
done
# Output:
# 0
# 1
# 2
# 3
# 4