for dir in $(ls -R |grep 'sgm' |cut -c0-4) do print "cd\\ ${dir} omnimark -s c:\omnimark\entychkr.xom ${dir}\.sgm -of c:\\entchkr\\\ ${dir}.out" >> ent3.bat done