사용자 도구

사이트 도구


linux:bash

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
linux:bash [2017/01/03 13:14]
kwon37xi [for loop 숫자]
linux:bash [2018/05/17 23:30]
kwon37xi
줄 1: 줄 1:
 ====== Bash ====== ====== Bash ======
 +===== Oh My Bash =====
 +  * [[https://github.com/ohmybash/oh-my-bash|oh-my-bash]] bash 확장
 +
 ===== Redirect ===== ===== Redirect =====
   * http://www.cyberciti.biz/faq/redirecting-stderr-to-stdout/   * http://www.cyberciti.biz/faq/redirecting-stderr-to-stdout/
줄 150: 줄 153:
 read varname # varname 으로 입력값 저장 read varname # varname 으로 입력값 저장
 read -p 'press enter' varname # prompt read -p 'press enter' varname # prompt
 +</code>
 +
 +===== shell script 파라미터 갯수 검사 =====
 +[[http://stackoverflow.com/questions/6482377/check-existence-of-input-argument-in-a-bash-shell-script|Check existence of input argument in a Bash shell script]]
 +<code sh>
 +if [ $# -eq 0 ]
 +  then
 +    echo "No arguments supplied"
 +    exit
 +fi
 +
 +# 혹은 특정 파라미터가 "" empty 인지 검사
 +if [ -z "$1" ]
 +  then
 +    echo "No argument supplied"
 +    exit
 +fi
 </code> </code>
  
줄 165: 줄 185:
   * [[https://www.gitbook.com/book/mug896/shell-script/details|Bash Shell Script]] 한국어   * [[https://www.gitbook.com/book/mug896/shell-script/details|Bash Shell Script]] 한국어
   * [[http://coffeenix.net/doc/shell/introbashscript.htm|Bash Script intro]]   * [[http://coffeenix.net/doc/shell/introbashscript.htm|Bash Script intro]]
 +  * [[https://zwischenzugs.com/2018/01/06/ten-things-i-wish-id-known-about-bash/|Ten Things I Wish I’d Known About bash – zwischenzugs]]
linux/bash.txt · 마지막으로 수정됨: 2024/02/07 08:41 저자 kwon37xi