I want to practice using head, uniq and cut, for this data here.
I know this thread but it focuses too much on cat and external programs.
I would like a simpler answer.
I want to take interval from the data file, e.g. lines 800-1600.
I am not sure if cut is intended for this task with the flags -n and -m. At least, I could not extract lines, just patterns in some byte locations.
Running mikeserv's answer
Code 1.sh:
for i in 2 5
do head -n"$i" >&"$((i&2|1))"
done <test.tex 3>/dev/null
and data
1
2
3
4
5
6
7
8
9
10
11
Running the code as sh 1.sh gives empty line as an output, although it should give 3 4 5 6 8. What do I understand wrong in Mike's answer?
How would you select line intervals in data by sed, tail, head and cut?