변수입력1 Bash: Pass Shell Variables To awk How do I pass shell variables to awk command or script under UNIX like operating systems? The -v option can be used to pass shell variables to awk command. Consider the following simple example, root="/webroot" echo | awk -v r=$root '{ print "shell root value - " r}' In this example search file using awk as follows: #!/bin/bash # Usage : Search word using awk for given file. # Syntax: ./script ".. 2012. 7. 18. 이전 1 다음 728x90