"Fossies" - the Fresh Open Source Software Archive

Member "littleutils-1.2.4/scripts/lreplace.1" (28 Mar 2021, 2368 Bytes) of package /linux/privat/littleutils-1.2.4.tar.lz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 .TH LREPLACE 1 "2021 Jan 15" littleutils
    2 .SH NAME
    3 lreplace \- replace one string with another in a file using sed
    4 .SH SYNOPSIS
    5 \fBlreplace\fR
    6 [\fB\-d\fR\~\fIdelimiter\fR]
    7 [\fB\-h(elp)\fR]
    8 \fB\-i\fR\~\fIINSTRING\fR
    9 \fB\-o\fR\~\fIOUTSTRING\fR
   10 [\fB\-q(uiet)\fR]
   11 [\fB\-v(erbose)\fR]
   12 [\fB\-z(ero_length_input_processed)\fR]
   13 [\fB\-Z(ero_length_output_permitted)\fR]
   14 \fIfile\|.\|.\|.\fR
   15 .SH DESCRIPTION
   16 \fBlreplace\fR performs string substitutions on text files.  This is
   17 accomplished using the \fBsed\fR and \fBtempname\fR utilities.
   18 .SH OPTIONS
   19 .TP
   20 \fB\-d\fR\~\fIDELIMITER\fR
   21 Set the \fBsed\fR delimiter.  The default value is\~'\fI#\fR'.
   22 .TP
   23 \fB\-h\fR
   24 Print help and quit.
   25 .TP
   26 \fB\-i\fR\~\fIINSTRING\fR
   27 Required option.  This is the input string that will be replaced.  It must be
   28 of non-zero length.
   29 .TP
   30 \fB\-o\fR\~\fIOUTSTRING\fR
   31 Required option.  This is the output string that will be substituted in place
   32 of the input string.  A zero-length string is allowable here.
   33 .TP
   34 \fB\-q\fR
   35 Quiet output.  No output commentary will be printed.
   36 .TP
   37 \fB\-v\fR
   38 Verbose output.  Commentary about unchanged files will be printed in addition
   39 to the normal commentary about changed files.
   40 .TP
   41 \fB\-z\fR
   42 Process zero-length input files.  Normally \fBlreplace\fR will skip input files
   43 with zero length to avoid spurious changes to lock files and such, but this
   44 flag can be specified to permit such changes.
   45 .TP
   46 \fB\-Z\fR
   47 Permit zero-length output files.  Normally \fBlreplace\fR will refuse to
   48 generate zero-length output files as a means of protecting against replacement
   49 strings that accidentally contain the delimiter, but this flag can be specified
   50 to permit such changes.
   51 .SH EXAMPLE
   52 .TP
   53 Replace all instances of "big apple" with "small pear" in fruit.txt.
   54 lreplace -i 'big apple' -o 'small pear' fruit.txt
   55 .SH "SEE ALSO"
   56 \fBsed\fR(1), \fBtempname\fR(1)
   57 .SH COPYRIGHT
   58 Copyright (C) 2004-2021 by Brian Lindholm.  This program is free software; you
   59 can use it, redistribute it, and/or modify it under the terms of the GNU
   60 General Public License as published by the Free Software Foundation; either
   61 version 3, or (at your option) any later version.
   62 
   63 This program is distributed in the hope that it will be useful, but WITHOUT ANY
   64 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   65 PARTICULAR PURPOSE.  See the GNU General Public License for more details.