【发布时间】:2015-07-26 11:32:23
【问题描述】:
我正在寻找在我们的 AIX v7 平台上完成此任务的方法。我没有强大的 unix(AIX) 背景,但我正在尝试编写 bash 脚本来执行重复功能。
非常简单,我希望 bash 脚本等到某个字符串出现在日志末尾。该字符串可能已经存在于其他地方的日志中。
我已阅读对类似问题的回复,并且答案使用了我们系统上不可用的选项。以下是我找到的回复: 1) 使用 read(我们的 AIX 版本中没有 -t 选项) Shell function to tail a log file for a specific string for a specific time
2) 使用 pstree(未安装 pstree) Unix to tail solution for waiting for a specific string or quitting after a timeout
3) 使用超时(未安装超时) Run tail -f for a specific time in bash script
4) 使用 tail --pid(--pid 选项不可用)
【问题讨论】: