Awk CLI

Table of Contents

Save modifications in place howto

There are two options:

  1. Use gawk only provided inplace extension:

    gawk -i inplace '{ gsub(/foo/, "bar") }; { print }' file1 file2 file3
    
  2. Use a temp file manually:
awk '{ print }' file > tmp && mv tmp file