For some reason the above code does not seem to work.
This is my code:
<--START
a = "This is a print statement
print a
b = "This contains print statement"
print b
END-->
DESIRED:
<--START
a = "This is a print statement
#print a
b = "This contains print statement"
#print b
END-->
Line 4 of the code (print b) should also be commented i.e tabs and space before the first word should be taken care of.
I'm trying to use:
sed 's/[^][pP][rR][iI][nN][tT]/#print/'
sed 's/^[pP][rR][iI][nN][tT]/#print/'
But nothing happens. No part of the code is commented.
If I use:
sed 's/[pP][rR][iI][nN][tT]/#print/'
The first occurence is commented correctly but I want it to be commented only if the line starts with the keyword.