[olug] Text search and Replace

Vincent.Raffensberger at dtn.com Vincent.Raffensberger at dtn.com
Tue Nov 25 16:45:32 UTC 2003


Use find or grep to find the file you want to edit and then use ex to edit 
it.

Here's an example:
This will find regular files in /your/path with a file name matching 
your_file* and then change the "broke_test_line" to 
"#broke_no_more_test_line".

find /your/path -type f -name your_file* -exec ex {} -c 
:%s/^broke_test_line/#broke_test_line/ -c wq \;

Enjoy



Jeff Norton <jnorton at jggt.com> 
Sent by: olug-bounces at olug.org
11/25/2003 09:54 AM
Please respond to
jnorton at jggt.com; Please respond to
Omaha Linux User Group <olug at olug.org>


To
OLUG at olug.org
cc

Subject
[olug] Text search and Replace







I want to search a directory on my computer and replace certain text
within documents with a new text.

_______________________________________________
OLUG mailing list
OLUG at olug.org
http://lists.olug.org/mailman/listinfo/olug




More information about the OLUG mailing list