hi people;
this is my two awk code:
nawk '/cell[0-9]+-/{r=(NF==8) ? $4FS$5FS$6 : NF==7 ? $4FS$5 : $4 ;c=split(r,rr);for (i=1;i<=c;i++){if(rr != "111111"){printf($3" %d ""\n",(i+3))}}printf("")}' /home/gc_sw/str.txt > /home/gc_sw/predwn.txt
nawk -F'[-/ ]*' '{gsub(/ *$/,"")}$0=$1$($NF-2)' /home/gc_sw/predwn.txt > /home/gc_sw/down.txt
and the error is:
nawk: syntax error at source line 1
context is
{gsub(/ *$/,"")}run >>> gc_sw/down. <<< txt=$1$($NF-2)
nawk: bailing out at source line 1
in the error the red part is not same as my second original code. instead of red part, there should be $0. $0 is assigned to something and it is being used there. i think the variables are inside each other. how can i make these two nawks nested?