title: Removing multiple block of lines of a text file in bash
body: <p>Assume a text file with 40 lines of data. How can I remove lines 3 to 10, 13 to 20, 23 to 30, 33 to 40, in place using bash script?</p>
  
  <p>I already know how to remove lines 3 to 10 with <code>sed</code>, but I wonder if there is a way to do all the removing, in place, with only one command line. I can use <code>for loop</code> but the problem is that with each iteration of loop the lines number will be changed and it needs some additional calculation of line numbers to be removed.</p>