From 1abfe5e82822a9e81a3bd1df2e7747afbc0ae1b9 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 8 Jan 2013 20:56:33 -0500 Subject: Add inplace file editing extension. --- awklib/eg/lib/inplace.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 awklib/eg/lib/inplace.awk (limited to 'awklib/eg/lib') diff --git a/awklib/eg/lib/inplace.awk b/awklib/eg/lib/inplace.awk new file mode 100644 index 00000000..a090d9e0 --- /dev/null +++ b/awklib/eg/lib/inplace.awk @@ -0,0 +1,14 @@ +# inplace --- load and invoke the inplace extension. + +@load "inplace" + +# Please set INPLACE_SUFFIX to make a backup copy. For example, +# you may want to set INPLACE_SUFFIX to .bak on the command-line or in a +# BEGIN block. + +BEGINFILE { + inplace_begin(FILENAME, INPLACE_SUFFIX) +} +ENDFILE { + inplace_end(FILENAME, INPLACE_SUFFIX) +} -- cgit v1.2.3