00.OS
seq
왕영주
2020. 8. 27. 22:02
for문을 사용할 때 seq
를 활용하곤한다.
seq [시작 숫자] [간격] [끝 숫자]
# for num in $(seq 1 10);do echo "test num = $num"; done
test num = 1
test num = 2
test num = 3
test num = 4
test num = 5
test num = 6
test num = 7
test num = 8
test num = 9
test num = 10
# seq 1 10
1
2
3
4
5
6
7
8
9
10
# seq 1 2 10
1
3
5
7
9
# seq 3 6
3
4
5
6
# seq 3 2 6
3
5
반응형