I am trying to delete a line in a file by a certain keyword entered. The whole file content is then automatically displayed without the word entered (success). However, the file itself is still containing the word which should've been deleted.
This is the content of my file smilies.txt
:) smile
:( sad
;) wink
:D laughing
;( crying
:O surprise
:P tongue
:* kiss
:X nowords
:s confuse
This is my script:
echo 'Enter a smiley or its description you want to delete: '
read delsmiley
sed /"$delsmiley"/d smilies.txt