Hi all,
I am using awk in order to print the output, sort them and then store it in a file but when I insert the sort command I am getting a syntax error.. Here is my below code .. Could you ppl please let me know If I am going the things correctly
CODE
id !~ /^\s*$/){print id,ip[id];}|sort -k 1 > "file"} for (key in h) {split(key,values," "); if(values[1] !~ /^\s*$/ && values[2] !~ /^\s*$/){print values[1],values[2],h[key]}|sort -k 1 -k 2 > "file"}}
awk: ^ syntax error
This should work, change:
to
and the same change for your other
sort. I.e., enclose your wholesortcommand inside double quotes.