I am trying to print lines between two patterns through sed command. But I want to include the line containing Pattern1 in the result and exclude the Pattern2. For ex:
/PAT1/
line 1
line 2
line 3
/PAT2/
The desired output is :
/PAT1/
line 1
line 2
line 3
I have tried this :
sed -n '/PAT1/,/PAT2/{/PAT2/{d};p}' Input_File
But it is excluding both the patterns.