Bash if

Jmnote (토론 | 기여)님의 2021년 10월 19일 (화) 12:56 판 (→‎같이 보기)

1 개요

Bash if
Syntax
if [조건]; then
	# if 블럭
else
	# else 블럭
fi

2 예시

He="John Smith"
if [ "$He" = "John Smith" ]; then
	echo "He is John Smith"
else
	echo "He is not John Smith"
fi
# He is John Smith
He="Jane Doe"
if [ "$He" != "John Smith" ]; then
	echo "He is not John Smith"
fi
# He is not John Smith

3 같이 보기

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