Printing the last column of a line in a file

前端 未结 11 1506
遇见更好的自我
遇见更好的自我 2020-12-12 11:33

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 fi

11条回答
  •  北荒
    北荒 (楼主)
    2020-12-12 12:38

    Not the actual issue here, but might help some one: I was doing awk "{print $NF}", note the wrong quotes. Should be awk '{print $NF}', so that the shell doesn't expand $NF.

提交回复
热议问题