This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 请教UNIX高手!I have a k-sh script running fine manually, but failed when scheduled as an auto job with Ctr-M. From the system log, the error comes at the definition of variable, like
WORKING_DIR=/abc/edf/xyz
echo $WORKING_DIR
This shows the correct path when run manually, but give EMPTY value when run with Ctr-M.
Any suggestion? Appreciated
-yunyunyun(晕头转向);
2007-8-9
{335}
(#3859813@0)
-
Answerthe problem is with env. When you run it manually, it uses your env. When you run with auto, it use the env of the crontab. So, compare them and added the env in your k-sh script.
To make it simple, just dump your env and copy it to the beginning of your k-sh script. Remove the duplicated ones.
-cici99(嘻嘻哈哈);
2007-8-9
{299}
(#3859904@0)
-
Thank you very very very much !!! I'll try it tomorrow.
-yunyunyun(晕头转向);
2007-8-9
(#3859915@0)