http://qs321.pair.com?node_id=1086285


in reply to Deleting first and last TWO(2) lines of a text file

HEAD=`head -1 myfile.txt` TAIL=`tail -1 myfile.txt` grep -v $HEAD myfile.txt|grep -v $TAIL>myfile.txt~ mv myfile.txt~ myfile.txt

Untested code. Needs some debugging.