Why would the behavior be any different? Could it be that cron is running it an entirely different shell, that doesn't understand the "if" statement?
That was it. I added a line to echo $SHELL to my debugging log file, and that was it: if I ran it from cron, $SHELL was /bin/sh; if I ran it from a command line, $SHELL was /bin/bash.
Changing the shebang from > #! to > #! /bin/bashdid the trick, and when I looked back at the original script, I found a shebang of
> #! /bin/shwhich I also changed. High hopes for finding successful test results tomorrow morning.
-- JHHL