Blame extension/inplace.3am

Packit 575503
.TH INPLACE 3am "Jun 17 2015" "Free Software Foundation" "GNU Awk Extension Modules"
Packit 575503
.SH NAME
Packit 575503
inplace \- emulate sed/perl/ruby in-place editing
Packit 575503
.SH SYNOPSIS
Packit 575503
.ft CW
Packit 575503
.nf
Packit 575503
gawk -i inplace ...
Packit 575503
.fi
Packit 575503
.ft R
Packit 575503
.SH DESCRIPTION
Packit 575503
The
Packit 575503
.I inplace
Packit 575503
extension adds two functions named
Packit 575503
.B inplace_begin()
Packit 575503
and
Packit 575503
.BR inplace_end() .
Packit 575503
These functions are meant to be invoked from the
Packit 575503
.I inplace.awk
Packit 575503
wrapper which is installed when
Packit 575503
.I gawk
Packit 575503
is.
Packit 575503
.PP
Packit 575503
By default, each named file on the command line is
Packit 575503
replaced with a new file of the same name whose contents
Packit 575503
are the results of running the AWK program.
Packit 575503
If the user supplies an AWK variable named
Packit 575503
.B INPLACE_SUFFIX
Packit 575503
in a
Packit 575503
.B BEGIN
Packit 575503
rule or on the command line, then the
Packit 575503
.I inplace
Packit 575503
extension concatenates that suffix onto the original
Packit 575503
filename and uses the result as a filename for renaming
Packit 575503
the original.
Packit 575503
.PP
Packit 575503
One can disable inplace editing selectively by placing
Packit 575503
.B inplace=0
Packit 575503
on the command line prior to files that should be processed normally.
Packit 575503
One can reenable inplace editing by placing
Packit 575503
.B inplace=1
Packit 575503
prior to files that should be subject to inplace editing.
Packit 575503
.\" .SH NOTES
Packit 575503
.SH BUGS
Packit 575503
While the extension does attempt to preserve ownership and permissions, it makes no attempt to copy the ACLs from the original file.
Packit 575503
.PP
Packit 575503
If the program dies prematurely, as might happen if an unhandled signal is received, a temporary file may be left behind.
Packit 575503
.SH EXAMPLE
Packit 575503
.ft CW
Packit 575503
.nf
Packit 575503
gawk -i inplace '\f(CIscript\fP' files ...
Packit 575503
.br
Packit 575503
gawk -i inplace -f \f(CIscriptfile\fP files ...
Packit 575503
.fi
Packit 575503
.ft R
Packit 575503
.SH "SEE ALSO"
Packit 575503
.IR "GAWK: Effective AWK Programming" ,
Packit 575503
.IR filefuncs (3am),
Packit 575503
.IR fnmatch (3am),
Packit 575503
.IR fork (3am),
Packit 575503
.IR ordchr (3am),
Packit 575503
.IR readdir (3am),
Packit 575503
.IR readfile (3am),
Packit 575503
.IR revoutput (3am),
Packit 575503
.IR rwarray (3am).
Packit 575503
.SH AUTHOR
Packit 575503
Andrew Schorr,
Packit 575503
.BR schorr@telemetry-investments.com .
Packit 575503
.SH COPYING PERMISSIONS
Packit 575503
Copyright \(co 2012, 2013, 2015
Packit 575503
Free Software Foundation, Inc.
Packit 575503
.PP
Packit 575503
Permission is granted to make and distribute verbatim copies of
Packit 575503
this manual page provided the copyright notice and this permission
Packit 575503
notice are preserved on all copies.
Packit 575503
.ig
Packit 575503
Permission is granted to process this file through troff and print the
Packit 575503
results, provided the printed document carries copying permission
Packit 575503
notice identical to this one except for the removal of this paragraph
Packit 575503
(this paragraph not being relevant to the printed manual page).
Packit 575503
..
Packit 575503
.PP
Packit 575503
Permission is granted to copy and distribute modified versions of this
Packit 575503
manual page under the conditions for verbatim copying, provided that
Packit 575503
the entire resulting derived work is distributed under the terms of a
Packit 575503
permission notice identical to this one.
Packit 575503
.PP
Packit 575503
Permission is granted to copy and distribute translations of this
Packit 575503
manual page into another language, under the above conditions for
Packit 575503
modified versions, except that this permission notice may be stated in
Packit 575503
a translation approved by the Foundation.
Packit 575503
.\" vim: set filetype=nroff :