I want to replace a particular content in my file with some pattern. I planned to use sed with -i option to replace the pattern and make the changes effect in a original file.
My sample file content ( test.txt ) :
My script is as follows:
system("sed -ie 's/\(.*\)/Number => \1/' test.txt");
When I executed the script, numerals aren't changed to Number => 1. It remains same.
Note: When I executed the sed command in shell prompt, it replaced the content of file properly as Number => 1 properly.