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 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., (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