Bash:将文本文件的最后一行读入变量

Tom*_*Liu 6 linux bash git-bash

我想读取一个名为history.txt的文本文件,其中包含多行,并将最后一行的内容存储到名为"tag"的变量中.

谢谢

eft*_*ft0 19

tag=$( tail -n 1 history.txt )