There are multiple print statements in my awk program and i want them to pass it back to shell variables. Is it possible.
For eg:
awk \'{ r=10; q=20;
The bash read statement can be used to capture awk output into shell variables:
read
$ read rr qq <<<$(awk 'BEGIN{ r=10; q=20; rr = sprintf("%04.0f", r); qq = sprintf("%05.0f",q); print rr,qq}') $ echo $rr $qq 0010 00020