delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/06/02:36:52

X-Spam-Check-By: sourceware.org
Date: Fri, 6 Oct 2006 08:36:23 +0200
From: Thomas Porschberg <thomas DOT porschberg AT osp-dd DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: bash scripts fail with bash3.1-8
Message-ID: <20061006083623.4e6e8985@porschberg.osp-dd.de>
In-Reply-To: <Pine.GSO.4.63.0610050930250.12019@access1.cims.nyu.edu>
References: <002101c6e702$9978f5f0$04fa080a AT CORK DOT ARRISI DOT COM> <00e501c6e705$5409f7f0$a501a8c0 AT CAM DOT ARTIMI DOT COM> <20061004100511 DOT 536596b4 AT porschberg DOT osp-dd DOT de> <eg0jeo$i5a$1 AT sea DOT gmane DOT org> <20061005094404 DOT 4bb8f5cc AT porschberg DOT osp-dd DOT de> <Pine DOT GSO DOT 4 DOT 63 DOT 0610050930250 DOT 12019 AT access1 DOT cims DOT nyu DOT edu>
X-Mailer: Sylpheed-Claws 2.1.0 (GTK+ 2.8.3; i686-suse-linux-gnu)
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

Am Thu, 5 Oct 2006 09:38:23 -0400 (EDT)
schrieb Igor Peshansky :

> On Thu, 5 Oct 2006, Thomas Porschberg wrote:
> 
> > Am Wed, 04 Oct 2006 10:19:52 -0500
> > schrieb mwoehlke :
> >
> > > Thomas Porschberg wrote:
> > > > Am Tue, 3 Oct 2006 17:02:29 +0100
> > > > schrieb "Dave Korn" :
> > > >> On 03 October 2006 16:43, Turly O'Connor wrote:
> > > >>> By way of an example as to what broke, note that in the
> > > >>> following that  "cleartool" is not a cygwin tool (it's a
> > > >>> Windows executable), writing its CRLF-terminated output to
> > > >>> Windows' stdout.
> > > >>>
> > > >>> CHECKOUTS=`cleartool lsc -all -cvi -s`  # list all my
> > > >>> checkouts
> > > >>>
> > > >>> I used to be able to do
> > > >>>
> > > >>> for one in $CHECKOUTS ; do echo $one Hello ; done
> > > >>>
> > > >>> C:/Path/To/file1 Hello
> > > >>> C:/Path/To/file2 Hello
> > > >>>
> > > >>> Now it seems that "$one" above contains the binary CR, so I
> > > >>> get:
> > > >>>
> > > >>> Hello h/To/file1
> > > >>> Hello h/To/file2
> > > >>>
> > > >>> What do I need to do to get this working again?
> > > >>   How about
> > > >>
> > > >> CHECKOUTS=`cleartool lsc -all -cvi -s | d2u`  # list all my
> > > >> checkouts
> > > >>
> > > >> or
> > > >>
> > > >> for one in $((echo $CHECKOUTS | d2u)) ; do echo $one Hello ;
> > > >> done
> > > >>
> > > >> depending on how happy cleartool is on piping output to a
> > > >> cygwin program.
> > > >
> > > > This is exactly the problem I have with my sqlplus call.
> > > > Is there a way to solve it without introducing the d2u filter ?
> > >
> > > You could try the new shopt... but have you considered arranging
> > > for 'sqlplus' to point to a shell script that would exec
> > > 'sqlplus.exe' and pipe it through d2u?
> > >
> > I tried the new "shopt -s igncr;#' but it does not work for this
> > case. (It does work if I have CR polluted files but not with the
> > piped stdout result)
> > Your approach with the additional shell script looks good. Thank
> > you. But it was not necessary in the past and now I have to do it
> > for every Windows program I call from cygwin and that writes to
> > stdout. ( ATM I see only sqlplus in my case :-) ).
> 
> If you want textmode pipes, add "nobinmode" to your CYGWIN environment
> variable.  See <http://cygwin.com/cygwin-ug-net/using-cygwinenv.html>
> for more information.

Yep, cool thing. It works and now I can abandon my sqlplus wrapper
script. Thank you.

Thomas

-- 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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