Bash party

Bash 헷갈릴 때 보는 포스트 Variable Assignment 띄어쓰기 없이 변수명=값. 환경변수와는 별개. foo=bar # OK echo $foo # output: bar foo =bar # WRONG; arg0: “foo”, arg1: “=bar” foo = bar # WRONG; arg0: “foo”, arg1: “=”, arg2: “bar” foo= bar # WRONG; executes “bar” with empty envvar “foo” Double Quotes vs. Single Quote 작은 따옴표는 literal string, 큰따옴표는 치환 실행함 foo=barecho “$foo” # output: barecho ‘$foo’ # output: $foo Bash special chars https://tldp.org/LDP/abs/html/special-chars.html Substitution # Command substitution # Execute command, and substitute $() with the output… Continue reading Bash party