Is there a way to set a variable in my current shell from within awk?
I\'d like to do some processing on a file and print out some data; since I\'ll rea
You can't export variables from a subshell to its parent shell. You have some other choices, though, including:
Make another pass of the file using AWK to count records, and use command substitution to capture the result. For example:
FNR=$(awk 'END {print FNR}' filename)
wc -l < filename to get your count.