1 개요[ | ]
- Bash if
Syntax
Bash
Copy
if [조건]; then
# if 블럭
else
# else 블럭
fi
2 예시[ | ]
Bash
Copy
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
Bash
Copy
He="Jane Doe"
if [ "$He" != "John Smith" ]; then
echo "He is not John Smith"
fi
# He is not John Smith
3 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- Bash (3)
로또번호 생성 ―Pinkcrimson
리눅스 날짜 기준으로 파일 삭제하기 ― 백승현리눅스 날짜 기준으로 파일 삭제하기 ― Jmnote