paulobrads
Programmer
I have the following awk command followed by a pipe in a shell script. I've been advised using fflush can force immediate piping of data rather than buffering.
How can I actually use it in this instance though? All the recommendations I see online are for specifying fflush(filename) but here it's this command I want to flush, not some other file.
The fflush as shown seems to make no difference.
Cheers.
Code:
awk '{
gsub(/"/,"\\\"", $0);
for(i=7; i<=NF; i++){
if(substr($6,1,6)!="GetRes"){
if(substr($6,1,2)!="C=")
printf $i " " $6 "\n";
else if($(i+1) != "") printf $(i+1) " " $7 "\n";
}
}
fflush();}' | perl lookup.pl
How can I actually use it in this instance though? All the recommendations I see online are for specifying fflush(filename) but here it's this command I want to flush, not some other file.
The fflush as shown seems to make no difference.
Cheers.