groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] pdfmom grep (was parallel text processing)


From: Ralph Corderoy
Subject: Re: [Groff] pdfmom grep (was parallel text processing)
Date: Sat, 09 Sep 2017 10:31:14 +0100

Hi Peter,

> The grep in pdfmom is returning a binary file hit when it encounters
> the diacritic in 
>
>   .ds pdf:look(pdf:bm1) L'├ętranger

What does locale(1) output for you where you run this pdfmom command?

> The solution is to pass the -a flag to grep.

How about 

    groff ... 2>&1 | LC_ALL=C grep '^\.ds' | groff ...

BTW, pdfmom has a bug shown by that strace command I suggested.

    system("groff ... 2>&1 | grep '^\.ds' | groff ...");

That's a double-quoted Perl string so `\.' is escaping the dot and grep
sees a plain dot for `any character'.  The backslash needs doubling.

    $ perl -wl
    print "groff ... 2>&1 | grep '^\.ds' | groff ...";
    print "groff ... 2>&1 | grep '^\\.ds' | groff ...";
    ^D
    groff ... 2>&1 | grep '^.ds' | groff ...
    groff ... 2>&1 | grep '^\.ds' | groff ...
    $

> Question: why does grep treat the presence of the diacritic as cause
> for saying "Binary file (standard input) matches"?

Need `locale's output.  :-)

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]