How to capture stderr of dos process running in bash shell??
Dave Korn
dave.korn.cygwin@googlemail.com
Sat Nov 14 04:05:00 GMT 2009
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
More information about the Cygwin
mailing list