Just do something like:
n=5
while IFS= read -ru3 line && (( n-- )); do
printf 'Got this line: "%s"\n' "$line"
done 3< some-file
Though, here, if it's about text processing, best would probably be to use a text processing tool:
LC_ALL=C sed 's/.*/Got this line: "&"/;5q' < some-file
Or:
awk '{print "Got this line: \""$0"\""}; NR == 5 {exit}' < some-file
Or:
perl -lne 'print qq(Got this line: "$_"); last if $. == 5' < some-file
Related: