[colug-432] Printing Last Field

jep200404 at columbus.rr.com jep200404 at columbus.rr.com
Wed Oct 14 17:59:33 EDT 2015


Compare the two following filter chains for printing the last field on a line.
Which one would you choose? Why?

    ... | rev | awk '{print $1}' | rev
    ... | awk '{print $NF}'

What are the interesting edge cases?


More information about the colug-432 mailing list