Save modifications in place with awk

前端 未结 8 1969
轻奢々
轻奢々 2020-11-21 23:32

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

8条回答
  •  无人及你
    2020-11-21 23:53

    Using tee

     awk '{awk code}' file | tee file
    

    the tee command take place and executed after the awk command is finished due to the |.

提交回复
热议问题