Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图将 dmesg 的最后一个新行(如果存在)删除到文件中。如果该文件有新行,我想回显它。没有太多,但我有这样的事情:
flog=$DIR/dmlog dm=$(dmesg > $flog) lines=$(wc -l $flog) <--- for example there is 60 lines
我需要检查行数是否大于前一个(60)。