Here is what i have worked out :
***************************************************************************
. /home/oracle/devapp.properties
serverold=$serverold
servernew=$servernew
portold=$portold
portnew=$portnew
grep -rl "$serverold" ./ | xargs sed -i "s/$serverold/$servernew/g"
grep -rl "$portold" ./ | xargs sed -i "s/$portold/$portnew/g"
***************************************************************************
But the concern is i am unable to replace when hostnames are under .jar.
i am unable to replace when hostnames are under .jar.
Does that mean you want to alter the contents of jar files? An approach like this will only work for text files - you would need to extract the jar file (and any other archive and compression formats like tar, zip gzip etc.), run the script recursively over the contents, and then jar (tar, zip, gzip, etc.) the file back together.
As I said, you need to unjar them, run the replacement command, and then jar them back together. Type "jar" at the command line to learn about all the jar tool options.
Post by:autobot
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
a bit of art, as a gift, the permaculture playing cards