| Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free! |
Unix script for find and replace
|
Original Message
|
Name: krishsays
Date: January 19, 2005 at 13:25:30 Pacific
Subject: Unix script for find and replace OS: Sun SolarisCPU/Ram: sparc |
Comment: Hi I need to write a unix script which does the following --------- Properties file Var1= XXXX Var2= YYY --------- ------------------------- File 1 Var1 = xxxx Var2= yyyy ----------------------- This script should search var1 and var2 in properties file and get those values and then search var1 and var2 in file1 and replace its value by the values achieved from first search. There are multiple file1. Scenario is we want to change the values in properties file and then we want to run this script and it should reflect this in change other files( html files) . Please can somebody help in this. Thanks, Krishan thanks Krishan
Report Offensive Message For Removal
|
|
Response Number 2
|
Name: cdac1000
Date: January 27, 2005 at 03:34:02 Pacific
|
Reply: well, what you could to is to source the properties file from within your script. In that case the modified variables are always available to you. All you need to do is read them using $VARX sign.
Report Offensive Follow Up For Removal
|

Post Locked
This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
Go to Solaris Forum Home
Results for: Unix script for find and replace
Need some help on Unix script Summary: I'm terrible when it comes to Unix scripting so I'm asking for some help. I have a list of IP addresses sometimes up to 2 or 3 hundred. What I have to do is telnet to each device in the list. I mad...
www.computing.net/answers/solaris/need-some-help-on-unix-script/4408.html
Auto script for updating resolv.conf Summary: Are you trying to change existing entries or add entries? If you want to change entries, and you have perl installed on the machine, try this: perl -e 's/old_stuff/new_stuff/gi' -p -i.bak filename Th...
www.computing.net/answers/solaris/auto-script-for-updating-resolvconf/870.html
finding and copying files Summary: I am trying to find a command or develop a script that will search for a group of files with a particular extension that are all residing in different subdirectories, take the output of that find comm...
www.computing.net/answers/solaris/finding-and-copying-files/1444.html