I am trying to put together a relatively simple script to comment out lines in a file which match a user/email combination. In the file fields are delimited with '/'s, and as such I have only been able to execute my command successfully as such:
sed -e "s/\(.*$MATCH\)/#\1/g" list.txt > list.txt.1
The issue with this is that if I choose to write to my input file (index.txt), the end result is an empty file. I have tried >> in place, and I end up with the original file contents plus their replacements.
Hopefully there is something obvious I'm missing, but regardless, can anyone shed some light on the situation?