This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: How to capture stderr of dos process running in bash shell??
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 14 Nov 2009 02:24:43 +0000
- Subject: Re: How to capture stderr of dos process running in bash shell??
- References: <26341304.post@talk.nabble.com>
aputerguy wrote:
> I am trying to capture the error messages of 'subinacl.exe' (a dos program
> included with Windows 2003 toolkit) which I am running from a bash script.
>
> However both the stderr and stdout of the process seem to go to bash stdout
> since redirecting bash stderr (2>) doesn't seem to have any effect.
>
> I assume this is because the dos process is running in a bash shell.
>
> Still, I was wondering whether there are any 'tricks' to somehow capture it.
It's not about whether it's running in one kind of shell or the other; what
matters is whether it is running in a DOS console or a GUI-style thing like
xterm or rxvt. In Cygwin GUI terminals, stdin and stdout are connected to
pipes, rather than to a win32 console device, which does confuse some win32
applications. You should be able to work around it by running bash in a
dos-style console instead of a GUI version, and making sure you do not have
the 'tty' option set in your CYGWIN environment variable (since that has the
effect of making even shells running in a console use pipes instead of talking
to the console, which is where the confusion arises).
cheers,
DaveK
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple