This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bash CR and backquotes trouble

Larry Hall (Cygwin) a écrit :
On 11/02/2006, Nicolas Roche wrote:
I am using bash version:

I have tried to use shopt -s igncr but I have an issue with the following shell construct:

t=`gcc --print-multi-lib` where gcc is a mingw gcc.

As my gcc is a mingw program, it outputs CR/LFs. In previous versions bash used to ignore the CR, so t variable was not containing any CR.
Now this is no more the case and this is causing some troubles

Why isn't "t=`gcc --print-multi-lib | d2u`" not a solution here?

Well for two reasons:
- portability. the same homemade scripts are also used among a large flavors of unixes (AIX, IRIX, HP-UX, Tru64, ....). dos2unix is not installed on all of them...
- these constructs are appearing in projects like GCC (I triggered the error while building a mingw GCC).

Is there any technical reason why igncr does not handle this case ? What's the exact semantic of this option by the way ?


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]