![]() |
|
|
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 |
| shell script to find and replace string in multiple files | pharos467 | Shell Programming and Scripting | 11 | 01-15-2009 11:40 AM |
| Find and Replace | NycUnxer | UNIX for Dummies Questions & Answers | 4 | 03-06-2008 12:20 AM |
| Find and Replace in multiple files (Shell script) | jatins_s | Shell Programming and Scripting | 13 | 11-05-2007 02:11 PM |
| find and replace in XML | wip_vasikaran | UNIX for Dummies Questions & Answers | 2 | 09-27-2007 01:16 PM |
| improving my script | bcheaib | Shell Programming and Scripting | 6 | 07-15-2004 11:59 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi all,
I have a script that scan files, find old templet and replace it with new one. #!/bin/ksh file_name=$1 old_templet=$2 new_templet=$3 # Loop through every file like this for file in file_name do cat $file | sed "s/old_templet/new_templet/g" > $file.new #do a global searce and replace and put the results mv $file.new $file #rename $file.new to original name of file done How can I replace the old templet with few rows templet ? for example: the old templet = xxxx the new templet = yyyy zzzz <script_name> <file_name> xxxx yyyy??zzzz What has to be instead the ?? in order to split the yyyy and zzzz for tow separate rows ? 10x Amir |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|