How to use variable from bash to use in awk?
22 Jul 2014If you want to use your variable from script inside awk, do the following
column=2
ps | awk '{print $var}' var=$column
or
column=2
ps | awk '{print $var}' var=$column
name="Hello"
echo $name | awk '{print var}' var=$name