1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Example: the seq command
seq 1 5
echo seq 1 5
echo `seq 1 5`
# Example: for-loops
for i in `seq 1 5`; do echo the current number is $i; done
# parentheses start a new sub-shell
for i in `seq 1 5`; do (echo the current number is $i| wc); done
# Example: while-loops
i=0; while [ $i -lt 5 ]; do echo $i; let i=i+1; done
# Example: until-loops
i=0; until [ $i -ge 5 ]; do echo $i; let i=i+1; done
Enter to Rename, Shift+Enter to Preview