Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-13 Thread Brian Inglis
On 2017-09-13 08:34, cyg Simple wrote: > On 9/12/2017 8:11 PM, Michel LaBarre wrote: >> Not trying to sound like a jerk, but I am still not clear as to why CYGWIN >> users are not using Linux unless they have to support code running in both >> POSIX and Windows environments in which case, the CYGW

Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-13 Thread cyg Simple
On 9/12/2017 8:11 PM, Michel LaBarre wrote: > > Not trying to sound like a jerk, but I am still not clear as to why CYGWIN > users are not using Linux unless they have to support code running in both > POSIX and Windows environments in which case, the CYGWIN mission could be > elaborated to men

RE: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-12 Thread Michel LaBarre
Nikolay, there is no ASCII newline/EOL character. A "newline/EOL" is a context-dependent notion. The fundamental CYGWIN position (Eric, Simple, Andrey): POSIX uses LF as EOL so POSIX-compliant behaviour in CYGWIN is to remove LF - windows be damned. A slightly more generous interpretation migh

Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-12 Thread cyg Simple
On 9/12/2017 9:06 AM, Eric Blake wrote: > On 09/12/2017 12:38 AM, Nikolay Melekhin wrote: >> https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution >> >> "...with any trailing newlines deleted." That is why I expected that >> bash should remove trailing newlines in command substitu

Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-12 Thread Eric Blake
On 09/12/2017 12:38 AM, Nikolay Melekhin wrote: > https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution > > "...with any trailing newlines deleted." That is why I expected that > bash should remove trailing newlines in command substitution results, > which are CRLF on Windows. N

Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-12 Thread cyg Simple
On 9/12/2017 1:38 AM, Nikolay Melekhin wrote: > Hi Eric, > > Thanks! This option is what I am looking for. > However I cannot agree with you on bash behavior in Cygwin. Section of > command substitution in bash documentation says: > > https://www.gnu.org/software/bash/manual/bash.html#Command-Sub

Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-12 Thread Andrey Repin
Greetings, Nikolay Melekhin! Please don't top-post. Thank you. > Thanks! This option is what I am looking for. > However I cannot agree with you on bash behavior in Cygwin. Section of > command substitution in bash documentation says: > https://www.gnu.org/software/bash/manual/bash.html#Command

Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-11 Thread Nikolay Melekhin
Hi Eric, Thanks! This option is what I am looking for. However I cannot agree with you on bash behavior in Cygwin. Section of command substitution in bash documentation says: https://www.gnu.org/software/bash/manual/bash.html#Command-Substitution "...with any trailing newlines deleted." That is

Re: Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-11 Thread Eric Blake
On 09/11/2017 04:27 PM, Nikolay Melekhin wrote: > > I'd expect that Cygwin must remove CRLF symbols from backtick results, You expected wrong - by default Cygwin does the same as Linux, which does NOT remove CR from command substitution (only LF). > but remove only LF symbol. It gets different r

Extra CR symbol from backticks on Cygwin 2.9.0

2017-09-11 Thread Nikolay Melekhin
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 000 20 57 69 6e 0d 20 0a 007 CYGWIN 000 20 57 69 6e