사용자 도구

사이트 도구


linux:bash

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
linux:bash [2021/02/11 15:35]
kwon37xi [실행 결과 변수에 저장]
linux:bash [2021/10/18 15:33]
kwon37xi [File Path dir/filename 분리]
줄 40: 줄 40:
  
 ===== 계산 하기 ===== ===== 계산 하기 =====
-  * ''$((계산식))'' 로 계산결과를 받을 수 있다.+  * ''%%$((계산식))%%'' 로 계산결과를 받을 수 있다.
   * [[https://www.gnu.org/software/bash/manual/html_node/Shell-Arithmetic.html#Shell-Arithmetic|Shell Arithmetic (Bash Reference Manual)]]   * [[https://www.gnu.org/software/bash/manual/html_node/Shell-Arithmetic.html#Shell-Arithmetic|Shell Arithmetic (Bash Reference Manual)]]
  
줄 169: 줄 169:
 basename "/path/to/filename.ext" # filename.ext basename "/path/to/filename.ext" # filename.ext
 </code> </code>
 +  * [[linux:realpath|realpath]] : full 경로 확인
 ===== Filename name / extension 분리 ===== ===== Filename name / extension 분리 =====
   * [[http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash|파일 이름에서 이름과 확장자 분리하기]]<code sh>   * [[http://stackoverflow.com/questions/965053/extract-filename-and-extension-in-bash|파일 이름에서 이름과 확장자 분리하기]]<code sh>
줄 254: 줄 254:
 ===== Special parameters ===== ===== Special parameters =====
   * [[https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html|Special Parameters (Bash Reference Manual)]]   * [[https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html|Special Parameters (Bash Reference Manual)]]
 +
 +===== function 목록 / 정의 =====
 +  * [[https://stackoverflow.com/questions/4471364/how-do-i-list-the-functions-defined-in-my-shell|bash - How do I list the functions defined in my shell? - Stack Overflow]]
 +
 +<code sh>
 +# 함수 목록 보기
 +declare -F
 +declare -f # 정의 포함 전체 목록
 +# 함수의 정의 보기
 +declare -f <function이름>
 +# or
 +type <function이름>
 +</code>
 +
 ===== 참조 ===== ===== 참조 =====
   * http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html   * http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
linux/bash.txt · 마지막으로 수정됨: 2024/02/07 08:41 저자 kwon37xi