OS/Linux

bin sh if

노루아부지 2019. 7. 27. 01:20

if [ $cnt = 5 ]; then

   echo "aaa"

else

   if [ $cnt = 6 ]; then

      echo "bbb"

   fi

fi

 

1. else if문은 존재하지 않는다.

2. 대괄호( "[" ) 는 반드시 공백이 있어야 한다.

3. 닫는 괄호오른쪽에는 세미콜론(;)이 존재해야 한다.

728x90

'OS > Linux' 카테고리의 다른 글

쉘(shell)에서 문자열 쪼개기 (split)  (0) 2019.07.27
bin sh add  (0) 2019.07.27
libconfig comfile and install  (0) 2019.07.27
[linux] tcpdump  (0) 2019.07.27
linux 사용자, 사용자 그룹  (0) 2019.07.26
loading