![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to find files which has more than one occurance of pattern | Prahlad | Shell Programming and Scripting | 10 | 08-08-2008 12:16 PM |
| Find a pattern and replace using sed. | maridhasan | Shell Programming and Scripting | 5 | 09-18-2007 01:43 AM |
| find pattern and replace another field | sergiioo | Shell Programming and Scripting | 3 | 04-11-2007 12:19 AM |
| find and replace a pattern in a file | krishnamaraju | Shell Programming and Scripting | 1 | 08-29-2006 10:02 AM |
| how find and replace into different files | ran | UNIX for Dummies Questions & Answers | 1 | 03-18-2005 03:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi
How can I looking for a pattern found in more than one file and replace it with anther pattern this what I was used: find . -name "account.adrs" -depth -follow -exec grep -l "Email = ;" {} \; this print the files name -which is account.adrs- and its path -which is deferent for each file- which contains the pattern "Email = ;" I need to replace this pattern by: "Email = \"\" ;" please help |
|
||||
|
Quote:
Does it mean we need a perl script named "i.bak" to do this task. I am not good at perl from command line. here is another script. little modification from PxT's Script #!/bin/sh FILES=`find . -name "account.adrs" -depth -follow -exec grep -l "Email = ;" {} \;` for file in $FILES; do sed -e 's/Email = ;/Email = \"\" ;/' $file > temp mv -f temp $file done |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|