ahernandez
Technical User
Hello everyone,
I have two questions regarding exit codes. Using the following command as an example:
rsh remote_server ddate
will give an exit value of '0'. Is there a way to check the exit code of the command that is performed on the remote machine ?
Also, I am using /usr/sbin/ufsdump in a script, with a ' |tee -a $LOGFILE ' piped to the end of it in order to get the standard output sent to a logfile. The value of $? will only give me the exit code of the 'tee' command. Is there any way to get the exit code of the 'ufsdump' AND keep using 'tee' ?
I know that if I run the command without the 'tee' extension, I can get a proper exit status. Is there a way to keep the tee piece and STILL be able to get an exit code from the ufsdump part ?
Thank you to anyone who can help or explain why this is impossible.
Thanks
Alan Hernandez
arhernandez@imcglobal.com
I have two questions regarding exit codes. Using the following command as an example:
rsh remote_server ddate
will give an exit value of '0'. Is there a way to check the exit code of the command that is performed on the remote machine ?
Also, I am using /usr/sbin/ufsdump in a script, with a ' |tee -a $LOGFILE ' piped to the end of it in order to get the standard output sent to a logfile. The value of $? will only give me the exit code of the 'tee' command. Is there any way to get the exit code of the 'ufsdump' AND keep using 'tee' ?
I know that if I run the command without the 'tee' extension, I can get a proper exit status. Is there a way to keep the tee piece and STILL be able to get an exit code from the ufsdump part ?
Thank you to anyone who can help or explain why this is impossible.
Thanks
Alan Hernandez
arhernandez@imcglobal.com