replace 2.24 - The sane person's alternative to sed
Here's a brief summary of replace:
The replace package, first released way back in 1994,
provides a much easier way than sed of replacing one or more strings with
others in one or more text or binary files or from standard input.
Features include:
- Freely modifiable and re-distributable source code
- Multiple string replacements in one command
- Replace strings in files or in standard input/output
- Binary or text files can have their strings replaced
- Auto-detection of binary files (can be overridden)
- Supports large files over 2GB
- Automatic case adjustment (can be overridden)
- Automatic backup of original unmodified file (can be overridden)
- Automatic retention of original owner, group and permissions of files
- Specify strings in either ASCII or hex
- Optional interactive prompting
- "Fake" mode to see what replacements would be done without actually replacing the strings
- Optional retention of timestamp of original unmodified file
- Optional following of soft-links before replacements attempted
- Optional string padding (before or after the new string)
- Optional verbose mode (2 levels of verbosity)
- Optional multiple directory tree recursion with optional suffix matching
- Optional Web tree recursion (i.e. replace in Web-related files only)
- Optional zero termination of binary replacement strings
For a full history of how replace has progressed over the years, there's
a ChangeLog available. If you're still not
convinced, there's a comprehensive
man
page to inspect and you can look at the
README
too.
You can download the source code to the latest replace release, 2.24, here:
HTTP: [UK]
FTP: [UK]
You can also download pre-compiled replace 2.24 binaries:
- HP-UX 11.11 PA-RISC binary depot: [UK]
- HP-UX 11.23 PA-RISC binary depot: [UK]
- HP-UX 11.23 Itanium binary depot: [UK]
Note: The HP-UX binary depots are gzipped and there's installation
instructions
for those depots available.
I'm interested in binaries compiled for other platforms - please e-mail
[email protected]
if you have successfully built binaries on a non-HP-UX platform and wish to
contribute them here.
Also available from this author:
calc 1.01
- A BASIC-style expression evaluator