seq 1 100
echo {1..100}
for ((i=1; i<=100; i++)); do echo $i ; done
使用 seq 與 {a..b}
for i in $(seq 1 100); do echo $i ; done for i in {1..100}; do echo $i ; done
印出奇數
for i in $(seq 1 2 100); do echo $i ; done
印出偶數
for i in {2..100..2}; do echo $i ; done
Last updated 4 years ago