0

I have a file like this:

When, in the course of human events, 
it becomes necessary for one people to dissolve 
*** Start copy here ***
the political bonds which have connected them 
with another, and to assume among the powers of 
*** End copy here ***
the earth, the separate and equal station to 
which the laws of nature and of nature's God entitle them 

and I want to write a one line terminal command to extract the lines between *** Start copy here *** and *** End copy here *** so the output should be:

the political bonds which have connected them 
with another, and to assume among the powers of 

How would I do this? I don't want to use awk (I've been playing around with sed but can't get it right) and the other responses I've found find words rather than sentences, which confuses me a bit.

2 Answers2

1

Following awk may help you in same.

awk '/*** End copy here ***/{flag="";next}/*** Start copy here ***/{flag=1;next} flag'  Input_file
RavinderSingh13
  • 130,504
  • 14
  • 57
  • 93
1
sed -e '1,/^\*\*\* Start copy here \*\*\*$/d' -e '/^\*\*\* End copy here \*\*\*$/,$d' tmp.txt
Jack
  • 5,801
  • 1
  • 15
  • 20