Shell Variables in AWK Expressions?

Paul_Melson@keykertusa.com Paul_Melson@keykertusa.com
Mon, 1 Oct 2001 13:34:43 -0400


>     What does the data in this file look like?  It might be easier to do
>this all inside awk if its not scattered about randomly.  What might help
>for this particular instance is :
>
>echo -n `eval awk '{NR == ${pool}}' column${file}.txt`

Won't using `eval` give me the errorlevel of the awk command, which in this
case would be 1, because awk doesn't like the braces around the condition
or the variable?

According to the GNU Awk User's Guide, the proper syntax should be:

awk '{NR == $pool}' column${file}.txt

But instead of the ${pool} line of the file column${file}.txt, I get:

pool: not found

Ideas?

Thanks,
PaulM