public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Extra CR symbol from backticks on Cygwin 2.9.0
@ 2017-09-11 21:36 Nikolay Melekhin
  2017-09-11 22:00 ` Eric Blake
  0 siblings, 1 reply; 10+ messages in thread
From: Nikolay Melekhin @ 2017-09-11 21:36 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-09-13 18:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-11 21:36 Extra CR symbol from backticks on Cygwin 2.9.0 Nikolay Melekhin
2017-09-11 22:00 ` Eric Blake
2017-09-12  5:38   ` Nikolay Melekhin
2017-09-12  9:20     ` Andrey Repin
2017-09-12 13:03     ` cyg Simple
2017-09-12 13:06     ` Eric Blake
2017-09-12 13:10       ` cyg Simple
2017-09-13  0:11         ` Michel LaBarre
2017-09-13 14:34           ` cyg Simple
2017-09-13 18:47             ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).