Blame extension/inplace.3am

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