![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rsh to change multiple ip in multiple servers? | kenshinhimura | Shell Programming and Scripting | 2 | 02-18-2008 03:04 AM |
| How to make ulimit change permanent | nervous | UNIX for Dummies Questions & Answers | 3 | 08-25-2007 01:28 AM |
| find all scripts to change DNS name?? | Bhups | Shell Programming and Scripting | 0 | 06-29-2006 01:39 AM |
| is there any way to make flat file from some of scripts ? | umen | Shell Programming and Scripting | 0 | 02-18-2006 05:42 PM |
| Regarding Make Scripts | S.Vishwanath | UNIX for Dummies Questions & Answers | 5 | 08-15-2001 02:36 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
What do you want to change in the script, programming code or only variables?
If you want to change variables you can put these in a file. You read these variables by using commands like grep and awk print. |
|
||||
|
If I understand you correctly you want to change one specific regex in a script to another. you can use sed to do global substitutions.
sed -e s/foo/bar Build a list file with ls > listfile and edit it. Then: listfile=/path/to/listfile for i in $listfile do sed -e s/foo/bar $i done echo Return Code: $? The echo at the bottom will return a 0 or a 1 .. 0 if successfull and 1 if it fails. jiin |
|
||||
|
if you have gnu sd
Code:
sed -i 's/string/string1/g' file* |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|