【发布时间】:2021-08-18 11:27:43
【问题描述】:
我正在编写一个 bash 脚本来帮助记录我们在 AWS 上运行的系统。
它最后运行的命令的简化版本是aws logs tail | grep "term"。一切正常,但是当我使用 ctrl + c 关闭日志流时,出现以下错误:
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
我可以阻止这种情况发生吗,还是应该在aws logs 脚本中捕获它?
【问题讨论】:
-
这是应该在 aws 日志脚本中捕获的内容。