Hiya,
I'm trying to so something simple, but everything related in previous posts on different forums seem overcomplicated.
What do I want to do:
I have a file (/home/richard/.qmail) which contains:
Code:
| /usr/local/psa/bin/psa-spamc accept
| true
And I have a script (/home/richard/script.sh) which contains:
Code:
SEARCH="| \/usr\/local\/psa\/bin\/psa-spamc accept\n"
sed "s/$SEARCH//g" /home/richard/.qmail > /home/richard/.qmail2
My expected output (/home/richard/.qmail2) would be:
In other words, I want to use sed to find and replace the text
Code:
| /usr/local/psa/bin/psa-spamc accept
INCLUDING the LINE BREAK and basically delete the whole line, so that line 2 would shift up to line 1.
Any help MUCH appreciated, thanks in advance!
Richard