bash awk to variable code example
Example: pass awk varible to bash
x=10
y=30
text="some_texts"
awk -v a=$x -v b=$y -v c="$text" 'BEGIN {ans=a+b; print c " " ans}'
# for text it need " "
x=10
y=30
text="some_texts"
awk -v a=$x -v b=$y -v c="$text" 'BEGIN {ans=a+b; print c " " ans}'
# for text it need " "