I want to use sed to comment out a certain command in a js file. The command is called processLoad(..). I came up with expression below but it doesn't do what I expect it to do. The computer that I am on belongs to my provider, so I do not know the version of linux that is running on the machine. [added:]
sed -r -i 's_^\([ \t]+processLoad.*\)$_//\1_' test.txt
I hope to replace a line:
processLoad('mystr');
into
// processLoad('mystr')
I figured out that '/' as substitute separation character would pose problems with the // as comments, so I choose _ as substitute separation character.