I have searched, but have come up short with an answer. I want to print the last line (or record) in a file; then print the first line using only awk. I know how to print first line:
NR == 1{print}
and last line
END{print}
However, how can I switch the positions? Is it even possible? I only get errors when I try to do so. Is there a way to integrate the
NR == 1{print}
command into the END command? Again, I only want to perform this in awk. Thanks!