• + 1 comment

    I could come up with 3 solutions for this. Since most of us are in a learning phase, this may help in broadening the understanding of the language-

    1. Remember "cut" for previous questions? You can change the delimiter to '\n', meaning that each field would now correspond to a line.
    cut -d$'\n' -f12-22
    
    1. Just like head, tail command exists which can print the last n lines of a file. So just pass the first 22 lines from head to tail via a pipe.
    head -n 22 | tail -n 11
    
    1. I actually came up with this solution first since I didn't know about tail. Basically, take the first 22 lines (from head) and pass then to a counter which will ignore the first 11 lines and start printing from the 12th.
    count=1
    head -n 22 | while read line; do if [ $count -ge 12 ]; then echo $line; fi; count=$(($count+1)); done
    

    Hope it helps!