Hello,
I was wondering how is it possible if I use this command:
awk 'NR >= 998 && NR <= 1000' file.txt
To exit after parsing the 1000th line ( last line targeted) ???
I observed that when executing this command for a large file, if the range of lines is at the beginning of the file it is quickly extracted, but awk will parse the entire file, and only after reaching the end of file it exits.
Same question goes for sed :
sed -n 'xx,yy p' file