gpt4 book ai didi

linux - BASH Linux 退出读取日志直到特定字符串

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:34:31 25 4
gpt4 key购买 nike

<分区>

我必须阅读日志,直到收到“Server Startup”。

当我得到字符串“startup”时,我必须退出 tail 命令并继续执行其余的脚本操作。

现在语法是:

cd /opt/path/path/path
LOG_FILE=$(ls -ltr | tail -1 |awk '{print $9}')
tail -f $LOG_FILE

提前致谢

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com