find
хорошо работает мне:
$ find . -name '*.pdf' -o -name '*.tex' | wc -l
75
$ find . -name '*.pdf' | wc -l
16
$ find . -name '*.tex' | wc -l
59
$ echo $((16+59))
75
Править:
Обработать особый случай: newline
в имени файла
$ find . \( -name '*.pdf' -o -name '*.tex' \) -printf x | wc -c
GRAPHEND
должен быть на новой строке.
#!/bin/bash
graph=$(cat <<GRAPHEND
graph match {
node[style=filled shape=point label= ""];
size="40.0,40.0";
fontsize=10.0;
overlap=false ;
spline=true;
nodesep=4.0;
"aaa" -- "aab" [penwidth=2.25 color="red" label="4" fontsize=7.0];
}
GRAPHEND
)
echo $graph