All,
I am trying to do this
1. Find line of a text file by grepping specific string
2. Once found, replace one of the string in that line with other.
Am using below script,
Quote:
#!/bin/bash
while read line
do
grep $line /tmp/export/raw-file.txt |sed 's/torspgw2/stjnspgw1/g;s/calspgw1/torspgw2/g'`
done </tmp/export/grep-file.txt
|
But looks like this script output the value as expected but not actually editing the file with new value. Is there anything i need to add further to make this work?