The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-03-2008
teodora teodora is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 13
update a file with values from other file in shell bash

Hello

I need to write a shell script to update properties between files.

I have 2 files as follow:

file1

urlWebserviceCheckAddress^=McoConfigGlobal.commonGLOBALUrlWebservice


file 2

urlWebserviceCheckAddress=http://localhost:8080/tags

Both files containt the same properties (left side of =)

I need to update the value of properties in file 2 with values of the same property from file 1.
If value of property in file 1 begins with McoConfigGlobal I need also to add ^ character before = (in file 2). At the end, the properties in both files must have the same values.

thanks in advance