delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/26/08:13:44

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990826121058.23046.rocketmail@web113.yahoomail.com>
Date: Thu, 26 Aug 1999 05:10:58 -0700 (PDT)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: Re: MS-DOS CR/LF compatibility in $() and ``?
To: Pontus Lidman <pontus AT mathcore DOT com>, cygwin AT sourceware DOT cygnus DOT com
MIME-Version: 1.0

--- Pontus Lidman <pontus AT mathcore DOT com> wrote:
> It seems that when the output of a command contains MS-DOS newlines
> (CR+LF), these are not stripped from the end of the output when command
> substitution is done.
> 
> Example:
> 
> echo -e "test\r\n" >file
> VAR=`cat file`
> echo xxx${VAR}yyy
> 
> this will produce the output
> yyytest
> 
> which indicates that there is a newline or carriage return at the end of
> the text of the variable. This is very unfortunate e.g. if the text was
> supposed to be a filename because test -f "$VAR" will fail even if the
> intended file exists.
> 
> Is there a way to get around this problem (Cygwin B20)?

This indicates to me that you're using binary mounts, am I correct?  It would
be normal for the \r to remain from the read when setting the variable with cat
if the file processing mode is set to binary.  If I'm correct, then you'll need
to filter the file to remove the \r just as you would on any UNIX environment
or you can move back to text mounts.

Also, which Cygwin dll are you using?  If it is stock b20.1 then see my pages
for more information.
===
Earnie Boyd <mailto:earnie_boyd AT yahoo DOT com>

Newbies, please visit
<http://www.freeyellow.com/members5/gw32/index.html>

(If you respond to the list, then please don't cc me)
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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