summaryrefslogtreecommitdiff
path: root/awklib/eg/lib/inplace.awk
diff options
context:
space:
mode:
Diffstat (limited to 'awklib/eg/lib/inplace.awk')
-rw-r--r--awklib/eg/lib/inplace.awk14
1 files changed, 14 insertions, 0 deletions
diff --git a/awklib/eg/lib/inplace.awk b/awklib/eg/lib/inplace.awk
new file mode 100644
index 00000000..6403a228
--- /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 rule.
+
+BEGINFILE {
+ inplace_begin(FILENAME, INPLACE_SUFFIX)
+}
+
+ENDFILE {
+ inplace_end(FILENAME, INPLACE_SUFFIX)
+}