Sort 77 Discussions, By:
Please Login in order to post a comment
Or use + prefix to start counting from the begining:
head -n 22 | tail -n +12
head -22 | tail -11
I think this is the simplest way to do it.
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-
cut -d$'\n' -f12-22
head -n 22 | tail -n 11
head -n 22 | while read line; do if [ $count -ge 12 ]; then echo $line; fi; count=$(($count+1)); done
Hope it helps!
sed -n '12,22p'
I found a simple solution using the sed command but I don't know if I can use it to solve this problem. Other approaches to find a solution consist in use both commands, head and tail, passing the output of the first command as input of the second command.