Skip to content

Instantly share code, notes, and snippets.

@geunho
Created April 14, 2020 09:53
Show Gist options
  • Select an option

  • Save geunho/f044e1b52c27c2f8810d0106ebbf3abf to your computer and use it in GitHub Desktop.

Select an option

Save geunho/f044e1b52c27c2f8810d0106ebbf3abf to your computer and use it in GitHub Desktop.
awk tips πŸ’«
# $OTHER_VAR이 숫자 ν˜•μ‹μ˜ 문자일 경우 -v μ˜΅μ…˜μœΌλ‘œ awk λ‚΄ λ³€μˆ˜ 지정을 ν•΄μ€˜μ•Ό 정상적인 μ‚°μˆ  연산이 μˆ˜ν–‰λ¨ πŸ˜„
# 두 번째 ν•­λͺ©μ΄ $OTHER_VAR 보닀 ν¬κ±°λ‚˜ 같은 라인을 μ°ΎλŠ”λ‹€.
awk -v t=$OTHER_VAR '$2 >= t' $FILE_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment