incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: run_locale_utils.sh
Date Thu, 17 Aug 2006 18:27:20 GMT
Martin Sebor wrote:
> Farid Zaripov wrote:
> 
>>   I can't understand what does the line "test -z "`echo $it | grep .cm`"
>> ;" in function below?
>>
>> check_locale_m()
>> {
>>     printf "Checking \"locale -m\" output..." >$dbgout
>>     loc_m_out=`${locale} -m`
>>     for it in $loc_m_out; do
>>         assertions=`expr $assertions + 1`
>>     if test -z "`echo $it | grep .cm`" ; then
>>             echo " incorrect." >$dbgout
>>             echo "ERROR: \"locale -m\" failed."  >$dbgout
>>             echo >$dbgout
>>             failedassertions=`expr $failedassertions + 1`
>>         fi;
>>     done;                       
>>     echo " correct." >$dbgout
>> }
>>
>>   I suppose that in command 'grep .cm' ".cm" is a regular expression and
>> grep utility should print lines that contains <anychar>cm?
> 
> 
> My guess is that whoever wrote it (cough, Liviu, cough) meant
> a literal period, not just any character (i.e., grep "\.cm")
> and the expression was supposed to look for the .cm file suffix
> (where .cm presumably stands for Character Map).
> 
> If that's correct the regular expression should look for ".cm"
> at the end each string, i.e., "\.c

Looks like the end of the expression got stripped. Let's try
again: "\.c$"

I.e., <backslash><period><C><dollar> (in case it happens again).

> 
>>
>>   On my machine on Windows locale -m produces:
>> ANSI_X3.110-1983
>> ...
> 
> [...]
> 
>>
>>   I not see the lines that matches to the ".cm"  regexp. And because of
>> this
>> the sanity check fails.
> 
> 
> I don't know why. We'd have to ask the original author if he
> still remembers -- Liviu?
> 
> Martin


Mime
View raw message