Hi. I'm hoping that someone can help me with a bash script to delete a block of lines from a file.
What I want to do is delete every line between two stings that are the same,
including the line the first string is on but not the second.
(Marked lines to match with !)
For example if I have:
fish
! cat
dog
ferret
lion
etc
! cat
kitten
zebra
What I'm looking to get is:
fish
cat
kitten
zebra
I've been trying to work out how to do this with sed but haven't had much luck.
Some 3-4 hours in, the closest I've gotten is deleting between the strings, or deleting both strings.
Thanks for reading. -Zykr