쉘 스크립트에서 if []; then 과 if [] then 의 차이점이 무엇인가요?
if [ condition ]; then fi
이것과
if [ condition ] then
fi
이것은 (;) 하나 차이입니다만, 세미콜론은 statement 의 종결을 뜻하죠. 그래서, 두 statement 를 한줄에 쓰고 싶을때 (;) 을 붙여서 쓴것 뿐입니다.
삽질의 대마왕...
if [ condition ];
if [ condition ]; then
fi
이것과
if [ condition ]
then
fi
이것은 (;) 하나 차이입니다만, 세미콜론은 statement 의 종결을 뜻하죠.
그래서, 두 statement 를 한줄에 쓰고 싶을때 (;) 을 붙여서 쓴것 뿐입니다.
삽질의 대마왕...