I am learning awk and I would like to know if there is an option to write changes to file, similar to sed where I would use -i option
awk
sed
-i
In case you want an awk-only solution without creating a temporary file and usable with version!=(gawk 4.1.0):
awk '{a[b++]=$0} END {for(c=0;c<=b;c++)print a[c]>ARGV[1]}' file