Script for Removing Lines from File / Blocking internet connection

Hey all. I am trying to write some scripts and need some assistance.

One:
I already have a script that appends lines to a file. I need a script that will remove those lines from that file, and have no idea how to go about doing this. Just need the command (if any) that can remove lines.

Two:
I am writing a script that will disable all outgoing HTTP connections and also have no idea how to do this. Any assistance would be great.

Thank you!

Well, if you know which line needs to be removed, you can get the line number and use sed
eg: Lets say you want to remove the line with the string "Remove me from the file"

#!/bin/ksh
linenum=`grep -n "Remove me from the file" filename | cut -f1 -d":"`
sed -i "${linenum}d" filename

or you can use grep

#!/bin/ksh
grep -v "Remove me from the file" filename >> filename.$$
mv filename.$$ filename

For blocking the http connections, probably you can use iptables,ipfilters etc

regards,
Ahamed

for one:

Do you know the line number for which the content needs to be removed or is that the content that needs to be removed?

Both of them can be done by inverse selection logic.