Bash if true/false

1 개요[ | ]

Bash if true/false

2 if[ | ]

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

3 if/else[ | ]

A=true
if [ $A = true ]; then
  echo TRUE
else
  echo NOT TRUE
fi
A=false
if [ $A = true ]; then
  echo TRUE
else
  echo NOT TRUE
fi
A=true
if [ $A = false ]; then
  echo FALSE
else
  echo NOT FALSE
fi
A=false
if [ $A = false ]; then
  echo FALSE
else
  echo NOT FALSE
fi

4 같이 보기[ | ]

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