Is there a way to determine whether the current line is the last line of the input stream?
Hmm the awk END variable tells when you have already reached the EOF. Isn't really much of help to you I guess
END
EOF