lreplace(1) lreplace(1)
NAME
lreplace - replace one string with another in a file using sed
SYNOPSIS
lreplace [-d delimiter] [-h(elp)] -i INSTRING -o OUTSTRING [-q(uiet)] [-v(erbose)] [-z(ero_length_input_processed)] [-Z(ero_length_out- put_permitted)] file...
DESCRIPTION
lreplace performs string substitutions on text files. This is accom- plished using the sed and tempname utilities.
OPTIONS
-d DELIMITER Set the sed delimiter. The default value is '#'. -h Print help and quit. -i INSTRING Required option. This is the input string that will be replaced. It must be of non-zero length. -o OUTSTRING Required option. This is the output string that will be substi- tuted in place of the input string. A zero-length string is allowable here. -q Quiet output. No output commentary will be printed. -v Verbose output. Commentary about unchanged files will be printed in addition to the normal commentary about changed files. -z Process zero-length input files. Normally lreplace will skip input files with zero length to avoid spurious changes to lock files and such, but this flag can be specified to permit such changes. -Z Permit zero-length output files. Normally lreplace will refuse to generate zero-length output files as a means of protecting against replacement strings that accidentally contain the delim- iter, but this flag can be specified to permit such changes.
EXAMPLE
Replace all instances of "big apple" with "small pear" in fruit.txt. lreplace -i 'big apple' -o 'small pear' fruit.txt
SEE ALSO
sed(1), tempname(1)
COPYRIGHT
Copyright (C) 2004-2020 by Brian Lindholm. This program is free soft- ware; you can use it, redistribute it, and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. littleutils 2020 Oct 19 lreplace(1)
littleutils 1.2.3 - Generated Mon Nov 30 19:34:18 CST 2020