네이버 공유하기
728x90
Bash - if 구문
- #!/bin/bash
- # else example
- if [ $# -eq 1 ]
- then
- nl $1
- else
- nl /dev/stdin
- fi
Operator | Description |
---|---|
! EXPRESSION | The EXPRESSION is false. |
-n STRING | The length of STRING is greater than zero. |
-z STRING | The lengh of STRING is zero (ie it is empty). |
STRING1 = STRING2 | STRING1 is equal to STRING2 |
STRING1 != STRING2 | STRING1 is not equal to STRING2 |
INTEGER1 -eq INTEGER2 | INTEGER1 is numerically equal to INTEGER2 |
INTEGER1 -gt INTEGER2 | INTEGER1 is numerically greater than INTEGER2 |
INTEGER1 -lt INTEGER2 | INTEGER1 is numerically less than INTEGER2 |
-d FILE | FILE exists and is a directory. |
-e FILE | FILE exists. |
-r FILE | FILE exists and the read permission is granted. |
-s FILE | FILE exists and it's size is greater than zero (ie. it is not empty). |
-w FILE | FILE exists and the write permission is granted. |
-x FILE | FILE exists and the execute permission is granted. |
반응형
'Tech > Linux' 카테고리의 다른 글
Installing Nagios Agent (NRPE) on CentOS 7 (0) | 2019.04.17 |
---|---|
크론탭 crontab 정리 (0) | 2019.04.05 |
리눅스 서버관리 - Parallel SSH - SSH 를 이용해서 여러대 리눅스 머신으로 명령어 보내기 (0) | 2018.10.18 |
CentOS 센트OS - 파라미터 최적화 스크립트 (0) | 2018.07.30 |
AWS 리눅스 SSH 접속 계정 정리 (0) | 2018.07.10 |
네이버 공유하기