Debian Codegraph @

upstream/debian-trixie/man3/inplace.3am

raw
1 .TH INPLACE 3am "Jun 26 2018" "Free Software Foundation" "GNU Awk Extension Modules"
2 .SH NAME
3 inplace \- emulate sed/perl/ruby in-place editing
4 .SH SYNOPSIS
5 .ft CW
6 .nf
7 gawk -i inplace ...
8 .fi
9 .ft R
10 .SH DESCRIPTION
11 The
12 .I inplace
13 extension adds two functions named
14 .B inplace_begin()
15 and
16 .BR inplace_end() .
17 These functions are meant to be invoked from the
18 .I inplace.awk
19 wrapper which is installed when
20 .I gawk
21 is.
22 .PP
23 By default, each named file on the command line is
24 replaced with a new file of the same name whose contents
25 are the results of running the AWK program.
26 If the user supplies an AWK variable named
27 .B inplace::suffix
28 in a
29 .B BEGIN
30 rule or on the command line, then the
31 .I inplace
32 extension concatenates that suffix onto the original
33 filename and uses the result as a filename for renaming
34 the original.
35 .PP
36 For backwards compatibility, the variable will also check
37 .B INPLACE_SUFFIX
38 (in the
39 .B awk
40 namespace) for the suffix to use if
41 .B inplace::suffix
42 is not set.
43 .PP
44 One can disable inplace editing selectively by placing
45 .B inplace::enable=0
46 on the command line prior to files that should be processed normally.
47 One can reenable inplace editing by placing
48 .B inplace::enable=1
49 prior to files that should be subject to inplace editing.
50 .\" .SH NOTES
51 .SH BUGS
52 While the extension does attempt to preserve ownership and permissions,
53 it makes no attempt to copy the ACLs from the original file.
54 .PP
55 If the program dies prematurely, as might happen if an unhandled signal
56 is received, a temporary file may be left behind.
57 .SH EXAMPLE
58 .ft CW
59 .nf
60 gawk -i inplace '\f(CIscript\fP' files ...
61 .br
62 gawk -i inplace -f \f(CIscriptfile\fP files ...
63 .fi
64 .ft R
65 .SH "SEE ALSO"
66 .IR "GAWK: Effective AWK Programming" ,
67 .IR filefuncs (3am),
68 .IR fnmatch (3am),
69 .IR fork (3am),
70 .IR ordchr (3am),
71 .IR readdir (3am),
72 .IR readfile (3am),
73 .IR revoutput (3am),
74 .IR rwarray (3am).
75 .SH AUTHOR
76 Andrew Schorr,
77 .BR [email protected] .
78 .SH COPYING PERMISSIONS
79 Copyright \(co 2012, 2013, 2015, 2018, 2019,
80 Free Software Foundation, Inc.
81 .PP
82 Permission is granted to make and distribute verbatim copies of
83 this manual page provided the copyright notice and this permission
84 notice are preserved on all copies.
85 .ig
86 Permission is granted to process this file through troff and print the
87 results, provided the printed document carries copying permission
88 notice identical to this one except for the removal of this paragraph
89 (this paragraph not being relevant to the printed manual page).
90 ..
91 .PP
92 Permission is granted to copy and distribute modified versions of this
93 manual page under the conditions for verbatim copying, provided that
94 the entire resulting derived work is distributed under the terms of a
95 permission notice identical to this one.
96 .PP
97 Permission is granted to copy and distribute translations of this
98 manual page into another language, under the above conditions for
99 modified versions, except that this permission notice may be stated in
100 a translation approved by the Foundation.
101 .\" vim: set filetype=nroff :