bash CR and backquotes trouble
Larry Hall (Cygwin)
reply-to-list-only-lh@cygwin.com
Thu Nov 2 18:32:00 GMT 2006
Nicolas Roche wrote:
> Larry Hall (Cygwin) a écrit :
>> On 11/02/2006, Nicolas Roche wrote:
>>> I am using bash version:
>>> 3.1.17(9)
>>>
>>> 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...
OK. So 'tr' is a better choice then.
> - these constructs are appearing in projects like GCC (I triggered the
> error while building a mingw GCC).
Which is why I suggested doing the translation so you don't get caught.
> Is there any technical reason why igncr does not handle this case ?
> What's the exact semantic of this option by the way ?
Dan has addressed this in his response so I won't repeat it.
--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
216 Dalton Rd. (508) 893-9889 - FAX
Holliston, MA 01746
--
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/
More information about the Cygwin
mailing list