grep problems

I like the korn shell too.

I'd figure out what results you expect from

grep -c '^[a-zA-Z]$' "$mins"

...and then assign that to a variable, and THEN compare it in your if statement. One thing that helps me greatly when I'm having a problem is simplifying down to one step at a time (heh... not just shell scripting either).

Also, put a line at the beginning of a troubled section like this:

set -x

...and at the end of that section,

set +x

they enable and disable debugging feedback, another very useful thing to have in your toolbox.