문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 마지막 판 양쪽 다음 판 | ||
linux:shell_script [2021/05/18 16:27] kwon37xi [다른 명령 Stream 으로부터 지속적으로 결과 읽어서 처리하기] |
linux:shell_script [2022/07/08 09:35] kwon37xi [명령의 존재 검사] |
||
---|---|---|---|
줄 48: | 줄 48: | ||
* [[http:// | * [[http:// | ||
- | ===== 참조 | + | ===== 실패시 fallback 처리 |
+ | * '' | ||
+ | <code sh> | ||
+ | # curl 명령 실패시에 " | ||
+ | TEST_RESULT=$(curl -Ss https:// | ||
+ | </ | ||
+ | |||
+ | ===== 명령의 존재 검사 ===== | ||
+ | * '' | ||
+ | |||
+ | <code sh> | ||
+ | command -v < | ||
+ | |||
+ | if ! command -v < | ||
+ | then | ||
+ | echo "< | ||
+ | exit | ||
+ | fi | ||
+ | </ | ||
+ | * '' | ||
+ | * '' | ||
+ | <code sh> | ||
+ | if hash gdate 2>/ | ||
+ | gdate " | ||
+ | else | ||
+ | date " | ||
+ | fi | ||
+ | </ | ||
+ | * [[https:// | ||
+ | |||
+ | ===== 참조 ===== | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
줄 57: | 줄 88: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// |