Differences between version 9 and predecessor to the previous major change of RegularExpression.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 9 | Last edited on Wednesday, July 27, 2005 7:13:42 pm | by MattBrown | Revert |
Older page: | version 7 | Last edited on Friday, May 16, 2003 11:13:03 am | by FelipeAlmeida | Revert |
@@ -20,13 +20,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
+perl(1) can also be used
for inplace substitutions like so
+ perl -pi -e 's/foo/bar/g' a.txt
+will replace all instances of
"foo" with "bar" in a.txt
-See also: perlrun(1)
+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