in reply to Variable Scope Issue?

I don't see how $cmd3 can generate that error with this script.

Therefore, I wonder if this is not the script that had the problem. Is that possible?

If the "myscript" that cron ran isn't THIS myscript, it could explain the issue...
--
Mike