사용자 도구

사이트 도구


linux:shell_script

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
마지막 판 양쪽 다음 판
linux:shell_script [2022/07/08 09:34]
kwon37xi
linux:shell_script [2022/07/08 09:35]
kwon37xi [명령의 존재 검사]
줄 69: 줄 69:
 </code> </code>
   * ''hash <명령>'' : 일반적인 명령 검사. alias, function 도 존재여부 exit code로 확인가능. 명령이 존재하면 exit code ''0''이고 아니면 오류 메시지. 따라서 error stream 처리(''2>/dev/null'')이 필요하다.   * ''hash <명령>'' : 일반적인 명령 검사. alias, function 도 존재여부 exit code로 확인가능. 명령이 존재하면 exit code ''0''이고 아니면 오류 메시지. 따라서 error stream 처리(''2>/dev/null'')이 필요하다.
-  * ''type <명령>'' : shell 내장 명령 혹은 keyword 검사. 설명 메시지 혹은 존재하지 않는 명령이면 오류메시지. +  * ''type <명령>'' : shell 내장 명령 혹은 keyword 검사. 설명 메시지 혹은 존재하지 않는 명령이면 오류메시지. ''&>/dev/null'' stream 처리 필요.
-  * +
 <code sh> <code sh>
 if hash gdate 2>/dev/null; then if hash gdate 2>/dev/null; then
linux/shell_script.txt · 마지막으로 수정됨: 2024/01/19 08:09 저자 kwon37xi