I have a file like this-
Asia
Europe
Africa
I want to search for word Europe and insert '#' in front of it which should appear like this-
Asia
#Europe
Africa
I tried:
sed -e 's/"Europe"/"#Europe"/g' $file
Also:
sed -r 's/"Europe"/"#Europe"/g' $file > $tmp`
mv $tmp $file
But it is not overwriting that particular line only,infact updating he file with a single line only like this:
#Europe