Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

awk match last occurrence

You can use $NF with the command awk to get the last argument as follows:
awk -F 'delimiter' '{print $NF}'
And for getting penultimate or previous arguments type $(NF-n):
awk -F 'delimiter' '{print $(NF-1)}' #penultimate argument
 
PREVIOUS NEXT
Tagged: #awk #match #occurrence
ADD COMMENT
Topic
Name
2+7 =