This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Extra CR symbol from backticks on Cygwin 2.9.0
- From: Nikolay Melekhin <nikolay dot melekhin at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 12 Sep 2017 00:27:28 +0300
- Subject: Extra CR symbol from backticks on Cygwin 2.9.0
- Authentication-results: sourceware.org; auth=none
Command line utilities in Windows add CRLF as new line symbol in an output.
For example:
echo "Windows"
TEST=`cmd /c "echo Win"`
echo " ${TEST} " | od -t x1
echo "CYGWIN"
TEST=`echo Win`
echo " ${TEST} " | od -t x1
Output:
Windows
0000000 20 57 69 6e 0d 20 0a
0000007
CYGWIN
0000000 20 57 69 6e 20 0a
0000006
I'd expect that Cygwin must remove CRLF symbols from backtick results,
but remove only LF symbol. It gets different results on Windows and
Linux. Result on Windows has additional CR symbol and for example
string comparision, which is working in Linux, fails in Windows.
Is any kind of an option/setting which removes such CRs or it is a bug
in Cygwin?
Best regards,
Nikolay Melekhin
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple