Awk return variable

Hi

I have 2 working script, now i'd like to get the return value from the first and give it to the 2 script (both script work correctly if I run it separately). so i think the problem is only the first line in the way i pass the variable.

in the final the "print lst", is just to check the variable, but i get an empty value.
Can anyone suggest a way to make it work please?

thanks

D.

what you are assigning to lst variable is nothing. so it will give you nothing. May be you try this if you want to get the number of records in temp2...

 
awk -v lst="$(awk 'END {print NR}' temp2)" ....

now I understand.

Thanks malcomex999