"Bash if true/false"의 두 판 사이의 차이

4번째 줄: 4번째 줄:
<syntaxhighlight lang='bash' run>
<syntaxhighlight lang='bash' run>
A=true
A=true
if [ $A = true ]
if [ $A = true ]; then
   then echo TRUE
   echo TRUE
fi
fi
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='bash' run>
<syntaxhighlight lang='bash' run>
A=false
A=false
if [ $A = true ]
if [ $A = true ]; then
   then echo TRUE
   echo TRUE
fi
fi
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='bash' run>
<syntaxhighlight lang='bash' run>
A=true
A=true
if [ $A = false ]
if [ $A = false ]; then
   then echo FALSE
   echo FALSE
fi
fi
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='bash' run>
<syntaxhighlight lang='bash' run>
A=false
A=false
if [ $A = false ]
if [ $A = false ]; then
   then echo FALSE
   echo FALSE
fi
fi
</syntaxhighlight>
</syntaxhighlight>

2021년 10월 19일 (화) 13:02 판

1 개요

Bash if true/false
A=true
if [ $A = true ]; then
  echo TRUE
fi
A=false
if [ $A = true ]; then
  echo TRUE
fi
A=true
if [ $A = false ]; then
  echo FALSE
fi
A=false
if [ $A = false ]; then
  echo FALSE
fi

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}