END means "execute the given block after processing the file", there is no print data associated with it.
If you want to process the last line, save each line in a variable in the default block, and then process the variable in the final block.
awk '{ last_line = $0; } END { /* do something with last_line */}' file
Or use tail before submitting data to awk :)
Diego
source share