From 77569eb830739efd56e4bfe76cbac76d4bbd8a98 Mon Sep 17 00:00:00 2001 From: grossws Date: Thu, 9 Jul 2015 12:12:47 +0300 Subject: [PATCH] `sed` alternative for replacing strings in files --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 327bdf6..560161b 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,10 @@ Notes: ```sh perl -pi.bak -e 's/old-string/new-string/g' my-files-*.txt ``` +Or use `sed` (it's more lightweight but its default regexp syntax differs from `perl`'s one, be carefull) +```sh + sed -i.bak 's/old-string/new-string/g' my-files-*.txt +``` - To rename many files at once according to a pattern, use `rename`. For complex renames, [`repren`](https://github.com/jlevy/repren) may help. ```sh