Bash Scripting - Text Processing in Scripts
Why does
awk '{print $NF}' file.txt print the last field of each line?awk '{print $NF}' file.txt print the last field of each line?NF is a special awk variable that stores the number of fields in the current line.$NF accesses the field number equal to NF, which is the last field.NF is a built-in variable holding the number of fields in the current line -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions