From: Junio C Hamano Date: Fri, 01 Jun 2007 03:57:50 GMT Subject: Re: [PATCH] Introduce git version --list-features for porcelain use Message-ID: <7vvee8z5q9.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20070601030959.GY7044@spearce.org> "Shawn O. Pearce" writes: > Why cat? Tcl is so horribly broken that to get data for both stdout > and stderr through a pipe I have to do something sick like: > > git fetch 2>&1 | cat > > because in Tcl its actually: > > set rdr [open "| git fetch |& cat" r] > > The |& means 2>&1| in normal shell. But that means I have to have > a process after it to receive the data. Normally that's cat. > But MinGW doesn't have cat. (Nor do they have dog, but neither > does Linux...). So I need a way to redirect output. Wait a minute. Who interprets |& in the above? Isn't it a shell? That's why I asked if you are writing for shell-less environment. If you are _not_, can't you do something like this instead? set rdr [open "| sh -c 'git fetch 2>&1'" r] that is, instead of running a command called "git", you invoke a command called "sh" with two parameters, the second parameter being a tad long string that happens to have three letter sequence '2>&1' in it.