Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我正在连接到另一台计算机上的 cygwin 终端并运行一个支持 TCL 的程序(CodeWarrior)。在程序内运行 tcl 命令不是问题。我正在尝试将 tcl 中的输出(例如从 puts)重定向到我正在运行的 cygwin 控制台。
如果终端是当前终端,您可以这样做:
set terminal [open /dev/tty] puts $terminal "Hi there!"
您可以让终端处理一个全局终端并且永远不要关闭它(直到程序退出)。
只需打开正确的设备,就可以写入其他终端(只要您有权限)。或者,如果您可以在 中找到文件描述符,则可以打开它/proc,尽管这本身就是一种黑色艺术。
/proc