Hi,
Here's hoping someone can help me. Here is an excerpt from a script I am having problems with.
-----------------------------------------------
rsh -l root svrsunlm2 mt -f /dev/rmt/0 stat
if [ "$?" = 0 ]
then
mailx -s "TAPE IS LOADED" $MAIL_USER << END
The backup tape for this evening has been loaded
END
fi
----------------------------------------------
The problem is the $? exit code is not giving me the correct code for the status of the mt command. Rather the status of the rsh -l instead. When you do this locally it works fine. But for some reason I am unable to trap the exit code using rsh. Any ideas?
Thanks
P A U L
Here's hoping someone can help me. Here is an excerpt from a script I am having problems with.
-----------------------------------------------
rsh -l root svrsunlm2 mt -f /dev/rmt/0 stat
if [ "$?" = 0 ]
then
mailx -s "TAPE IS LOADED" $MAIL_USER << END
The backup tape for this evening has been loaded
END
fi
----------------------------------------------
The problem is the $? exit code is not giving me the correct code for the status of the mt command. Rather the status of the rsh -l instead. When you do this locally it works fine. But for some reason I am unable to trap the exit code using rsh. Any ideas?
Thanks
P A U L