sriki32
1
I am looking for a script where I need to open a file and modify the data like changing the parameters.Can anyone help me?
open a file software.rsp . It already contains following data.
parameter = false
threads=100
user= demf
The above should be changed to
paramter=true
thread= 133
user = deefs
kurumi
2
$ ruby -ne ' print if gsub(/threads=.*/,"threads=330")' file
parameter = false
threads=330
user= demf
sriki32
3
I also want the script to create file in /folder/subfolder/file
and add the following
inventory_loc=/folder1/subfo1/Or/Inventory
inst_g=webspher
---------- Post updated at 11:36 AM ---------- Previous update was at 11:20 AM ----------
I am using ksh shell and ruby is not working.
frans
4
Don't use the -i option of sed for testing (dry run)
sed -i -e 's/parameter.*/parameter=true/' -e 's/threads.*/threads=133/' -e 's/user.*/user=deefs/' software.rsp
echo "inventory_loc=/folder1/subfo1/Or/Inventory
inst_g=webspher" > /folder/subfolder/file