delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/24/05:13:43

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Subject: pdksh: problem with read and string compare
To: cygwin AT cygwin DOT com
Message-ID: <OF392C9F6E.7797A9BF-ONC1256D12.003185C3@de.ibm.com>
From: "Thomas Muehlfriedel" <MUEHLE AT de DOT ibm DOT com>
Date: Thu, 24 Apr 2003 11:13:43 +0200
MIME-Version: 1.0

hello all,
I'm using cygwin-1.3.22 with pdksh.

A script developed on linux doesn't run on cygwin because there is a 0xd in
a string I read from standard input.
What happens is the following

A command spits out some multi-line output:

$ . ../script/rep.sh sqlactivity 1.1b

1
--------------------
                   -

  1 record(s) selected.

I read the fourth line ("-") with "read xx"  and try to see if it is a "-"
with

if [ $xx = "-" ]
then
      bla
else
      do something
fi

Under cygwin/win2k this fails because $xx contains "-0x0d". The equality op
doesn't like this and always goes into the else branch.
Has anyone seen this and gotten around somehow?  This might actually refer
to the problem reported in
"Erroneous line endings (cat,gawk,text mount)" Still the thread mentioned
did not give me an idea how to solve this problem.

regards

thomas


------------
Who is General Failure and why is he reading my harddisk?


--
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