Here is a
solution for the above post coming straight from a Linux forum.
I have been told that problem was that grep was reading on
stdin (for whatever it means...)
Spoiler:
Code:
pcregrep -o -h 'class=".+?"' * >fic_tmp.$$
for i in $(sort -u fic_tmp.$$); do echo "$i $(grep -rc $i fic_tmp.$$)"; done | sort -t ' ' -k2 -nr
Tried on one EPUB of mine.
Code:
roger@lmde64 ~/Bureau/Coups/OEBPS/Text $ pcregrep -o -h 'class=".+?"' * >fic_tmp.$$
roger@lmde64 ~/Bureau/Coups/OEBPS/Text $ for i in $(sort -u fic_tmp.$$); do echo "$i $(grep -rc $i fic_tmp.$$)"; done | sort -t ' ' -k2 -nr
class="smcpIncise" 225
class="smcpCentrage" 57
class="Header" 54
class="let" 35
class="let2" 35
class="let1" 35
class="Standard" 28
class="Centrage" 24
class="smcpTypeA" 17
class="smcpTypeV" 16
class="smcpDroite" 16
class="Subtitle" 5
class="Italdroite" 5
class="Heading" 2
class="smcpChanson" 1
class="frameFrame" 1
class="Chanson" 1
roger@lmde64 ~/Bureau/Coups/OEBPS/Text $
The result provides needed information (classes only).