I have a text file with following content (3 lines)
filename : output.txt
first line:12/12/2008
second line:12/12/2008
third line:Y
I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before.
I tried using
cat output.txt |sed -e 's/third line:Y/third line:Y/' , but in this case it writes the output to some other file and we have to replace that old file with new file.
Do we have a way to do this without replacing the old file with new file after using
sed command or can we do this any command other than
sed?