Try replacing sleep
with the full path to the command (possibly /usr/bin/sleep
) and see if that changes the behavior. If it does, then your script, when run under Torque, simply has a different (or empty) $PATH
variable.
You can either (a) continue to use explicit paths, or (b) set $PATH
explicitly in your script, e.g:
PATH=/bin:/usr/bin:/usr/local/bin