From efbf0cc51e0052a7f6674f022072f518dc6e2ff9 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sat, 13 May 2017 17:01:12 +0100 Subject: [PATCH] perl: tweak the -0 example --- pages/common/perl.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/common/perl.md b/pages/common/perl.md index 95f77d219c..fc5e6b51e8 100644 --- a/pages/common/perl.md +++ b/pages/common/perl.md @@ -22,10 +22,10 @@ `perl -p -i -e 's/{{find}}/{{replace}}/g' {{filename}}` -- Run a multi-line find/replace expression on a file (i.e. including line breaks): - -`perl -0 -p -i -e 's/{{foo\nbar}}/{{foobar}}/g' {{filename}}` - - Run a find/replace expression on a file, saving the original file with a given extension: `perl -p -i'.old' -e 's/{{find}}/{{replace}}/g' {{filename}}` + +- Run a multi-line find/replace expression on a file, and save the result in another file: + +`perl -p0e 's/{{foo\nbar}}/{{foobar}}/g' {{input_file}} > {{output_file}}`