This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to capture stderr of dos process running in bash shell??


On Sat, Nov 14, 2009 at 02:24:43AM +0000, Dave Korn wrote:
>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.

But that is clearly not the case here since stdout and stderr are being
bypassed and text is still showing up on the screen.  That is not a symptom
of stdout/stderr being attached to a pipe.

Although, hmm, on rereading it isn't clear that the output shows up on
the screen.  It sounds like the DOS program just might not differentiate
between stdout and stderr.

cgf

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]