Penguin
Diff: RegularExpression
EditPageHistoryDiffInfoLikePages

Differences between version 7 and predecessor to the previous major change of RegularExpression.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 7 Last edited on Friday, May 16, 2003 11:13:03 am by FelipeAlmeida Revert
Older page: version 5 Last edited on Friday, March 14, 2003 12:04:34 pm by JohnMcPherson Revert
@@ -19,8 +19,14 @@
 ----- 
 sed(1) is a "__s__cript __ed__itor" which uses regex's. sed is usually used for it's amazing search and replace capability. for (simple) example: 
  sed 's/foo/baz/g' <a.txt >b.txt 
 will search for "foo" and replace it with "baz" in a.txt and output the result in b.txt 
+-----  
+using perl(1) insted of sed(1) for inplace substitution:  
+ perl -pi -e 's/foo/bar/g' filename  
+will search for "foo" and replace it with "bar" in filename and output the result in filename itself  
+  
+See also: perlrun(1)  
 ----- 
 awk(1) is a tool for doing processing on record orientated files. It allows you to specify different actions to perform based on regex's. 
 ----- 
 See also: File [Glob]s