title: using sed to cut a part of file
body: <p>cat /opt/inventory.txt</p>
  
  <pre><code>###################################################################################
  Begin_detail_of 5678
  Request_No of the activity is 5678
  testProject
  Requester of the project is xyz
  xyz@test.com
  End_of 5678
  ####################################################################################
  ###################################################################################
  Begin_detail_of 1234
  Request_No of the activity is 1234
  testProject
  Requester of the project is xyz
  xyz@test.com
  End_of 1234
  ####################################################################################
  </code></pre>
  
  <p>When I use the number 1234 as below I get expected output as below</p>
  
  <pre><code>cat /opt/inventory.txt | sed -n -e '/Begin_detail_of\ 5678/,$p' | sed -e '/End_of\ 5678/,$d'
  Begin_detail_of 5678
  Request_No of the activity is 5678
  testProject
  Requester of the project is xyz
  xyz@test.com
  You have new mail in /var/spool/mail/root
  </code></pre>
  
  <p>But when I substitute the number with variable output is not as expected as below</p>
  
  <pre><code>[root@centoo script]# export num=5678
  [root@centoo script]# echo $num
  5678
  [root@centoo script]# cat /opt/inventory.txt | sed -n -e '/Begin_detail_of\ $num/,$p' | sed -e '/End_of\ $num/,$d'
  [root@centoo script]#
  </code></pre>
  
  <p>Please help to solve the issue.</p>