I currently have a front-end built in kornshell for operators to kick of regular mksysb’s for me. Inside the script I use a fairly common mksysb command (via sudo):
#*** called via kornshell script ***
/usr/local/bin/sudo mksysb -ie /dev/rmt0
RC=$?
Recently, I’ve noticed it would be nice to have logs of what actually happened during the mksysb. I wanted to have the stdout go to the screen and to a log file. Seems simple, right?
I planned on using :
/usr/local/bin/sudo mksysb -ie /dev/rmt0 | tee –a /mydir/myfile.log
RC=$?
However, the RC is actually the RC from the tee command, not from mksysb. This isn’t what I’m looking for. I need the RC to instruct the operator on what to do next.
I’ve tried - unsuccessfully:
MAKEBKUP()
{
/usr/local/bin/sudo mksysb -ie /dev/rmt0 | tee –a /mydir/myfile.log
RC=$?
}
MAKEBKUP | tee –a /mydir/myfile.log
Sorry this got so long, but I’m certain someone has come across this….Any ideas?
#*** called via kornshell script ***
/usr/local/bin/sudo mksysb -ie /dev/rmt0
RC=$?
Recently, I’ve noticed it would be nice to have logs of what actually happened during the mksysb. I wanted to have the stdout go to the screen and to a log file. Seems simple, right?
I planned on using :
/usr/local/bin/sudo mksysb -ie /dev/rmt0 | tee –a /mydir/myfile.log
RC=$?
However, the RC is actually the RC from the tee command, not from mksysb. This isn’t what I’m looking for. I need the RC to instruct the operator on what to do next.
I’ve tried - unsuccessfully:
MAKEBKUP()
{
/usr/local/bin/sudo mksysb -ie /dev/rmt0 | tee –a /mydir/myfile.log
RC=$?
}
MAKEBKUP | tee –a /mydir/myfile.log
Sorry this got so long, but I’m certain someone has come across this….Any ideas?