Linux/ShellScript

for문(2)

CleanSense 2018. 6. 5. 14:39
728x90

코드설명 : for문(2)


1
2
3
4
5
6
#!bin/sh
 
for((초기값;조건;변화))
do
    실행문
done
cs


실행예시 :


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
 
for((i=0;i<10;i++))
do
        echo "i = $i"
done
 
##########################
 
= 0
= 1
= 2
= 3
= 4
= 5
= 6
= 7
= 8
= 9
cs


728x90