【发布时间】:2016-05-25 16:26:56
【问题描述】:
我怎样才能将exec 命令的stdout“刷新”到我的脚本的stdout 而不“等待”结果执行返回?
例如,在以下脚本中,我希望 git clone 输出立即出现在我的脚本上下文中:
#!/usr/bin/tclsh
# git outputs progress of the clone download but it isn't visible in this script's context. How can I flush it?
exec git clone /path/to/some/repo.git
我猜我需要某种 pipe "|" 和 tee 的组合以及文件重定向。
好像没弄好。
【问题讨论】: