From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6859 invoked by alias); 24 Apr 2003 13:05:10 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 6852 invoked from network); 24 Apr 2003 13:05:09 -0000 Received: from unknown (HELO slinky.cs.nyu.edu) (128.122.20.14) by sources.redhat.com with SMTP; 24 Apr 2003 13:05:09 -0000 Received: from localhost (pechtcha@localhost) by slinky.cs.nyu.edu (8.11.7+Sun/8.11.7) with ESMTP id h3OD56n29688; Thu, 24 Apr 2003 09:05:06 -0400 (EDT) X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Thu, 24 Apr 2003 15:14:00 -0000 From: Igor Pechtchanski Reply-To: cygwin@cygwin.com To: Thomas Muehlfriedel cc: cygwin@cygwin.com Subject: Re: pdksh: problem with read and string compare In-Reply-To: Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2003-04/txt/msg02077.txt.bz2 On Thu, 24 Apr 2003, Thomas Muehlfriedel wrote: > > Ok, so it is an erroneous line endings problem. The tmp file > > containing the output of the external command has line seps of the > > form 0x0d 0x0d 0x0a. Does it help if I switch the drive to text-mode > > since drive e is mounted in binmode? > > > muehle at sparrow /cygdrive/e/DataDictionary/report/resource > > $ mount > > D:\software\cygwin\bin on /usr/bin type system (binmode) > > D:\software\cygwin\lib on /usr/lib type system (binmode) > > D:\software\cygwin on / type system (binmode) > > c: on /cygdrive/c type user (binmode,noumount) > > d: on /cygdrive/d type user (binmode,noumount) > > e: on /cygdrive/e type user (binmode,noumount) > > > -thomas > > I can do whatever I like I cannot get rid of those 0d0d0a at the end of > each line in the tmp file! I mounted the filesystem as text and played with > the CYGWIN env variable. Whenever I redirect multi-line output from a > standard windows program I get those endings. The tmp file looks like this: > > 00000000: 0d0d 0a31 2020 2020 2020 2020 2020 2020 ...1 > 00000010: 2020 2020 2020 200d 0d0a 2d2d 2d2d 2d2d ...------ > 00000020: 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 2d2d 0d0d --------------.. > 00000030: 0a20 2020 2020 2020 2020 2020 2020 2020 . > 00000040: 2020 2020 2d0d 0d0a 0d0d 0a20 2031 2072 -...... 1 r > 00000050: 6563 6f72 6428 7329 2073 656c 6563 7465 ecord(s) selecte > 00000060: 642e 0d0d 0a0d 0d0a > > And all I do is "db2 select ... " >tmp > So why is this so? > > -thomas Thomas, Windows console programs *do* put 0d0a at line endings irrespective of any cygwin settings or mounts. If you then redirect the output to a file on a text-mounted drive, an extra 0d will be added before a 0a (because that's how text mounts work). You might try piping the output through d2u. The "extra 0d on console reads" problem that you're having in pdksh is a separate beast entirely, and yes, it's probably related to the thread you quoted earlier. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Knowledge is an unending adventure at the edge of uncertainty. -- Leto II -- 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/