I've a problem : I would like to be able to delete lines beetwen two pattern in a file.
For example be able to delete the line equals to "line 1" beetwin "blablabla++" and "blablabla--"
line1
blablabla++
line1
line2
line3
blablabla--
line1
I've found a way to do it with sed :
sed '/blablabla++/,/blablabla--/{/line1/d}' ./file
It is working great. But the thing is that in my real file is more like :
line1/script
blablabla++
line1/script
line2/script
line3/script
blablabla--
line1/script
How could i do that ?
EDIT
I've choosen a bad example.
The thing is that i don't know what the line that i need to delete will be (the line will be sent as parameter). But i know one thing for sure is that they will contain "/" characters.
The thing is that when i do this :
sed '/blablabla++/,/blablabla--/{/$1/d}' ./file
The "/" that $1 contain will mess up with my sed.