linux-tutorial/codes/demos/bash/statement/forDemo.sh

12 lines
147 B
Bash
Raw Normal View History

2017-11-17 17:06:52 +08:00
#!/usr/bin/env bash
echo "print 1 to 5"
for i in {1..5}; do
echo $i;
done
echo "print 0 to 9"
for (( i = 0; i < 10; i ++ )); do
echo $i
done