I have a file that is constantly being written to/updated. I want to find the last line containing a particular word, then print the last column of that line.
The file looks something like this. More A1/B1/C1 lines will be appended to it over time.
A1 123 456
B1 234 567
C1 345 678
A1 098 766
B1 987 6545
C1 876 5434
I tried to use
tail -f file | grep A1 | awk '{print $NF}'
to print the value 766, but nothing is output.
Is there a way to do this?