쉘 스크립트에서 if []; then 과 if [] then 의 차이점이 무엇인가요?
if [ condition ]; then fi
이것과
if [ condition ] then
fi
이것은 (;) 하나 차이입니다만, 세미콜론은 statement 의 종결을 뜻하죠. 그래서, 두 statement 를 한줄에 쓰고 싶을때 (;) 을 붙여서 쓴것 뿐입니다.
삽질의 대마왕...
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
if [ condition ];
if [ condition ]; then
fi
이것과
if [ condition ]
then
fi
이것은 (;) 하나 차이입니다만, 세미콜론은 statement 의 종결을 뜻하죠.
그래서, 두 statement 를 한줄에 쓰고 싶을때 (;) 을 붙여서 쓴것 뿐입니다.
삽질의 대마왕...
댓글 달기