#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "[email protected]"
exec -ignorestderr -- {*}$argv >@stdout 2>@stderr
exit
$ wish test.sh -- sh -c date 2>&1 | cat
Thu Feb 13 23:08:09 2014
如果我不用管stdout或stderr,我得到:channel wasn't opened for writing
。但是如果它关闭了,我希望tcl将关闭的文件描述符传递给子进程。我不希望tcl捕获命令的输出。
我看你不知道什么是关闭fd是 – basin