![]() |
|
|
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 |
| shell script to find and replace string in multiple files | pharos467 | Shell Programming and Scripting | 11 | 01-15-2009 11:40 AM |
| replace multiple lines in multiple files | unihp1 | Shell Programming and Scripting | 1 | 09-21-2008 09:47 AM |
| Shell script to read multiple log files | esungoe | Shell Programming and Scripting | 1 | 08-08-2008 09:46 AM |
| Shell script to parse/split input string and display the tokens | yajaykumar | Shell Programming and Scripting | 3 | 08-08-2008 07:43 AM |
| Find and Replace in multiple files (Shell script) | jatins_s | Shell Programming and Scripting | 13 | 11-05-2007 02:11 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Shell Script to replace tokens in multiple files
I have multiple script files that I have created, that allow me to simply replace a few tokens at the top of the file, and then not have to go through the actual script and change anything. I have about 10 of them, but I was hoping to find a way to write a small script that would allow me to input what value I want those tokens to hold, and then run that script, and it would go through all the scripts I have and replace the tokens with the values I input in to the first script.
Not sure if I explained it very well, but here's an example. replaceScript.sh - serverScript1.sh serverScript2.sh serverScript3.sh when I run replaceScript.sh, I'd like to be able to input, say, 5 variables(var1-var2-...var5), then the replaceScript.sh will go through and replace those same variables that have been set in serverScript1-3, with the values I input in to the replaceScript.sh |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|