need help finding a specific email address in a file and deleting the line its on.
I'm new to this and I'm trying to create a script that will take a user supplied email address and find it in a file of email addresses (unique addresses, each address is at the start of its line.) and delete the line and save (replace) the file.
There are other applications that will insert email addresses at the top of the file so the most recent addition is away at the top. I can’t sort the file for this reason. I need to search for the email address and then delete its line from the file. I’ve tried working with sed, but it sends its output to screen and it won't (or I don't know how to get it to) save to an existing file. I’m trying to avoid redirection to a to a temp file and then writing it back as there is potential there to overwrite an entry that was inserted.