发布于 2020-05-06 16:48:20
创建脚本notify-pipe
#!/usr/bin/env sh
read notification
notify-send "Command Failed" "$notification" "$@"和管道stderr到stdout
$ ls /root 2>&1| notify-pipe可能的增强:获得通知摘要中的命令的bash get command that was used before pipe symbol。
谢谢你的帮助罗恩。
发布于 2020-05-06 00:14:56
通知-发送将不适用于piping
然而,您可以尝试: sudo pip安装通知-管道。
它接受piping
见此处:https://github.com/ron7/notify-pipe
您可以将stderr管道传输到stdout,并将其发送给通知管道。
command 2>&1|notify-pipehttps://stackoverflow.com/questions/61623833
复制相似问题