Bash Pass Shell Variables To Awk Script

Originally published at: https://www.cyberciti.biz/faq/linux-unix-appleosx-bsd-bash-passing-variables-to-awk/

How do I pass shell variables to awk command or script under Linux or UNIX-like operating systems? How do I use shell variables in an awk script? How can I allow awk to use shell variables?


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki