I know how to select a field from a line using the cut command. For instance, given the following data:
a,b,c,d,e
f,g,h,i,j
k,l,m,n,o
This command:
cut -d, -f2 # returns the second field of the input line
Returns:
b
g
l
My question: How can I select the second field counting from the end? In the previous example, the result would be:
d
i
n