Unix – How to print text between two line numbers into a new file in UNIX

awksedshellunix

I have a file like this (numbers on first column is line number)

30.<unit id=20>
31....
32.</unit>
33.<unit id=40?
34....
35.</unit>
36<unit id=20>
37...
38.</unit>
39.<unit id=40?
40....
41</unit>

I want to print lines between two line numbers, say 32 and 39. How can I accomplish this in Unix?
I'm new to unix.
Note: I don't want perl scripts please.

Best Answer

Another way with sed:

 sed -n '32,39p' filename