#!/bin/bash tempdir=”tmp”
outdir=”ocr” convert “$1” -colorspace Gray -depth 8 -resample 200x200 -verbose $tempdir/”$(echo $1| cut -d . -f1)_%04d.tif” ls $tempdir | sort | xargs -i -t -P 2 tesseract $tempdir/”{}” $outdir/”$(echo {}| cut -d . -f1)” exit 0