Help on ctmcreate
Posted: 15 Oct 2009 12:05
I am trying to build a script which utilizes ctmcreate with error catching. As an example,
ctmcreate adasdasdas
RC=${?}
if [ ${RC} -ne 0 ] ; then
echo "FAILED"
else
echo "SUCCESS"
fi
exit ${RC}
This should output FAILED and exit with a number other than 0 as the ctmcreate statement is wrong but it always would output SUCCESS and 0.. Please help.
Please tell me how I could catch all possible errors with the ctmcreate statement and exit with a number other than 0 if wrong..
Thanks.
Even this fails..
[xxxxx@ethp1234:/home/xxxxx]
$ ctmcreate asdadad
Invalid parameter:
usage: ctmcreate
….
..
[xxxxx@ethp1234:/home/xxxxx]
$ echo $?
0
ctmcreate adasdasdas
RC=${?}
if [ ${RC} -ne 0 ] ; then
echo "FAILED"
else
echo "SUCCESS"
fi
exit ${RC}
This should output FAILED and exit with a number other than 0 as the ctmcreate statement is wrong but it always would output SUCCESS and 0.. Please help.
Please tell me how I could catch all possible errors with the ctmcreate statement and exit with a number other than 0 if wrong..
Thanks.
Even this fails..
[xxxxx@ethp1234:/home/xxxxx]
$ ctmcreate asdadad
Invalid parameter:
usage: ctmcreate
….
..
[xxxxx@ethp1234:/home/xxxxx]
$ echo $?
0