想知道是否有人知道如何捕获和识别write到终端的传入命令.我已经尝试使用script -f然后使用tail -f跟随while循环的输出,但因为我跟踪的终端没有启动write它不会输出.不幸的是我没有root权限,不能玩pts或screendump,想知道是否有人知道实现这个的方法?
例:
Terminal 1 $ echo hello | write Terminal 2
Terminal 2 $
Message from Terminal 1 on pts/0 at 23:48 ...
hello
EOF
*Cause a trigger from which I can send a return message
Run Code Online (Sandbox Code Playgroud) bash ×1