Bash if

Jmnote (토론 | 기여)님의 2024년 4월 4일 (목) 14:43 판 (→‎같이 보기)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

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 }}