Hi,
I had a few questions regarding searching for a string and replacing it using perl scripts. I have 100's of files written in Unix shell scripts and I need to edit them all. Its like
I have to search exactly for function 2 and only replace the variable in function 2. I have to append a new value ggg to the variable only in function 2.
Everytime I try doing this with the perl one liner 's/searchtext/replacetext/g', it inserts in the wrong position and in the wrong function. Can you please help me with this as I am completely new to perl
Thanks
I had a few questions regarding searching for a string and replacing it using perl scripts. I have 100's of files written in Unix shell scripts and I need to edit them all. Its like
Code:
function1() { variable=xxx } function 2() { variable='aaa bbb ccc ddd' }
Everytime I try doing this with the perl one liner 's/searchtext/replacetext/g', it inserts in the wrong position and in the wrong function. Can you please help me with this as I am completely new to perl
Thanks
Comment