[118603] Используйте библиотеку многоточной арифметики GNU
GNU Multiple Precision Arithmetic Library
с помощью прилагаемой программы [118939]run-expr[118940]:
Загрузите и извлеките (вам понадобится громкая связь): [119136]tar -xvf gmp-5.1.3.tar.lz
В верхнем каталоге [119138]/configure[119139] и [119140]make[119141] (установка не требуется)
В демо-версиях/expr, [119142]make run-expr
Вывод:
Если я правильно понимаю, вы ищете что-то вроде этого (в Bash
):
#!/usr/bin/env bash
## avoid errors if a directory has no *tex files
shopt -s nullglob
directories=("Cardiology" "Rheumatology" "Surgery");
## Change this to set whichever options you want.
printf "%s\n%s\n" "\documentclass{YOURCLASS}" "\begin{document}"
for directory in ${directories[@]}
do
## Reset the counter, avoid empty sections.
c=0;
for file in "$directory"/*tex
do
let c++
[ "$c" -eq 1 ] && printf "\n%s\n" "\section{$directory}"
## Extract the wanted lines
perl -lne '$a=1 && print "" if /\\begin{question}/;
print if $a==1;
$a=0 if /\\end{question}/;' "$file"
echo ""
done
done
echo "\end{document}"
Если вы запускаете этот скрипт из каталога, который содержит кардиологию и т. Д., Он должен обеспечивать так: