I have a file (say file1.txt) and I have to search for a line which has a text replace it and replace another string too in the same line.
Eg:
file1.txt
--------
x='hai' y='world' z='unix'
x='hai'
y='world'
x='hai' z='perl' y='world' z="world" k="junk" b="world"
z='perl' x='hai' y='world' z="world" k="junk" b="world"
I have to go to line which has both 'hai' and 'world' and replace
'hai' to 'hello' and 'world' to 'universe' (all ocurrence which has 'hai' and 'world' in that line) as below
modified file
x='hello' y='universe' z='unix'
x='hai'
y='world'
x='hello' z='perl' y='universe' z="universe" k="junk" b="universe"
z='perl' x='hello' y='universe' z="universe" k="junk" b="universe"
Can you please give me a command or shell program to do that
Thanks
Ammu