Save modifications in place with awk

前端 未结 8 2084
轻奢々
轻奢々 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条回答
  •  萌比男神i
    2020-11-22 00:06

    following won't work

    echo $(awk '{awk code}' file) > file
    

    this should work

    echo "$(awk '{awk code}' file)" > file
    

提交回复
热议问题