0

In this comment, community member DannyDannyDanny asked if it is safe to redirect output of the awk command to the same file being used for input.

No one answered that comment, so I would like to formally ask that question here.

Specifically, my intent is to use this awk command:

awk '!($0 in a) {if (NF) a[$0]; print}' filename > filename

Please note that filename = filename.

muru
  • 72,889

0 Answers0