This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
pdksh: problem with read and string compare
- From: "Thomas Muehlfriedel" <MUEHLE at de dot ibm dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 24 Apr 2003 11:13:43 +0200
- Subject: pdksh: problem with read and string compare
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/