1INPLACE(3am)               GNU Awk Extension Modules              INPLACE(3am)
2
3
4

NAME

6       inplace - emulate sed/perl/ruby in-place editing
7

SYNOPSIS

9       gawk -i inplace ...
10

DESCRIPTION

12       The  inplace  extension  adds  two  functions named inplace_begin() and
13       inplace_end().  These functions  are  meant  to  be  invoked  from  the
14       inplace.awk wrapper which is installed when gawk is.
15
16       By  default, each named file on the command line is replaced with a new
17       file of the same name whose contents are the results of running the AWK
18       program.   If the user supplies an AWK variable named INPLACE_SUFFIX in
19       a BEGIN rule or on the command line, then the  inplace  extension  con‐
20       catenates that suffix onto the original filename and uses the result as
21       a filename for renaming the original.
22
23       One can disable inplace editing selectively by placing inplace=0 on the
24       command line prior to files that should be processed normally.  One can
25       reenable inplace editing by  placing  inplace=1  prior  to  files  that
26       should be subject to inplace editing.
27

BUGS

29       While the extension does attempt to preserve ownership and permissions,
30       it makes no attempt to copy the ACLs from the original file.
31
32       If the program dies prematurely, as might happen if an unhandled signal
33       is received, a temporary file may be left behind.
34

EXAMPLE

36       gawk -i inplace 'script' files ...
37       gawk -i inplace -f scriptfile files ...
38

SEE ALSO

40       GAWK:   Effective   AWK   Programming,   filefuncs(3am),  fnmatch(3am),
41       fork(3am), ordchr(3am),  readdir(3am),  readfile(3am),  revoutput(3am),
42       rwarray(3am).
43

AUTHOR

45       Andrew Schorr, schorr@telemetry-investments.com.
46

COPYING PERMISSIONS

48       Copyright © 2012, 2013, 2015 Free Software Foundation, Inc.
49
50       Permission  is  granted  to make and distribute verbatim copies of this
51       manual page provided the copyright notice and  this  permission  notice
52       are preserved on all copies.
53
54       Permission  is granted to copy and distribute modified versions of this
55       manual page under the conditions for verbatim  copying,  provided  that
56       the  entire  resulting derived work is distributed under the terms of a
57       permission notice identical to this one.
58
59       Permission is granted to copy and distribute translations of this  man‐
60       ual page into another language, under the above conditions for modified
61       versions, except that this permission notice may be stated in a  trans‐
62       lation approved by the Foundation.
63
64
65
66Free Software Foundation          Jun 17 2015                     INPLACE(3am)
Impressum