#!/usr/bin/sh /usr/bin/perl -ne 'print if $. >=17 && $. <= 39' infile.txt >outfile.txt