Вы можете найти ответ по двум ссылкам. сохранить -модификации -в -место
In latest GNU Awk (since 4.1.0 released), it has the option of "inplace" file editing:
Version 4.1 of gawk introduced the following features: The -i and --include options load awk library files.