in reply to Re: Print some lines in a range
in thread Print some lines in a range

Nice, but that doesn't stop reading the input file after line 50001 as the OP asked.