delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/13/21:09:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4AFE14EB.5020305@gmail.com>
Date: Sat, 14 Nov 2009 02:24:43 +0000
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: How to capture stderr of dos process running in bash shell??
References: <26341304 DOT post AT talk DOT nabble DOT com>
In-Reply-To: <26341304.post@talk.nabble.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019