Feb 4, 2003 #1 clonny2 MIS Jan 28, 2003 470 US I am having difficulty trying to get sed to match a sting and also grab the line before and the line after. IE # # MY Text Goes Here # I want to match those 3 lines and i can do the rest, which is going to delete all 3 lines from my file.
I am having difficulty trying to get sed to match a sting and also grab the line before and the line after. IE # # MY Text Goes Here # I want to match those 3 lines and i can do the rest, which is going to delete all 3 lines from my file.
Feb 4, 2003 #2 dickiebird Programmer Feb 14, 2002 758 GB You could use vi in a script : vi yourfile << EOF /# MY Text Goes Here - 3dd :wq EOF HTH Dickie Bird (-))) Upvote 0 Downvote
You could use vi in a script : vi yourfile << EOF /# MY Text Goes Here - 3dd :wq EOF HTH Dickie Bird (-)))
Feb 4, 2003 Thread starter #3 clonny2 MIS Jan 28, 2003 470 US Thanx, but I need the script to run ni-interactively. I can use vi in a script with out any problem . but thanks for the tip. Upvote 0 Downvote
Thanx, but I need the script to run ni-interactively. I can use vi in a script with out any problem . but thanks for the tip.
Feb 4, 2003 Thread starter #4 clonny2 MIS Jan 28, 2003 470 US Here is the answer. I finally figured it out. /^#/{ N /^# My Text*/d N /^#/d } Upvote 0 Downvote