Menu

Tree [0d980b] master /
 History

HTTPS access


File Date Author Commit
 src 2020-12-18 Miyamoto Miyamoto [f17d28] Fix compilation with gcc 8.3.0
 .gitignore 2020-12-18 Miyamoto Miyamoto [0d980b] Git-ignore TODO.md
 CMakeLists.txt 2020-12-18 Miyamoto Miyamoto [bcf9ea] Raise minimum required cmake to 3.13
 README.md 2020-12-18 Miyamoto Miyamoto [6b5a20] Review README
 build-version.sh 2014-11-02 David Voisin David Voisin [41e3d9] Script I added to speed up my deployments - Use...
 changelog.md 2015-01-22 David Voisin David Voisin [6a8f83] Version passes to 1.0.0 as it is considered sta...

Read Me

DESCRIPTION

Command line tool to replace strings and chunk of bytes in files.

Features

  • Fast replacement.
  • Handle huge files.
  • Replaces recursively in folders.
  • Accepts regular expressions patterns for search.
  • Replaces bytes by using their hexadecimal value.
  • Converts end lines into Unix, DOS/Windows and Mac OS formats.
  • Converts tabs to spaces and remove trailing spaces.

USAGE

$ sr [OPTION]... SEARCH REPLACE FILE...

Replace string SEARCH by string REPLACE into the specified file(s).

Use --help option for full options description.

$ sr --help

Examples

$ sr Hello Salut hello.txt
Replace strings "Hello" by "Salut" in file hello.txt

$ sr Hello '' .
Recursively delete "Hello" strings all files in the current directory

$ sr -d Hello '' .
Simulate (dry-run mode) the recursive deletion of strings "Hello" in all files in the current directory

$ sr -e '[hH]ello' Salut hello.txt
Replace strings that match regular expression "[hH]ello" by "Salut" in file hello.txt

$ sr -U hello.txt
Set file hello.txt endlines into Unix format

BUILD

Requires cmake and make.

$ mkdir build
$ cd build
$ cmake ..
$ make

Dynamic libraries dependencies

  • libboost_system.so
  • libboost_chrono.so
  • libboost_filesystem.so
  • libboost_program_options.so
  • libboost_regex.so