I have a file with its contents
apple
ball
....
....
....
cat
dog
from this, I want to get everything between lines with ball
and cat
, including ball
but not cat
. How can I accomplish it? I used the command sed -n '/ball/,/cat/ p' filename
, but it would print out ball
as well which I do not want.