I am splitting up a file with awk command, I want to name the file using a variable however I have not had much luck. Here is the line:
awk '/STX/ {f="$tp"++i;} {print > f}' $tp.mixed
this just creates files with $tp# as name.
I read the post "How to use shell variables in awk script" but was unable to figure out how to apply that to me question.