Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

c-shell script - capturing exit codes.

807559Jun 29 2004 — edited Jun 29 2004

Hi,

I have a c-shell script which runs our support desk through daily admin tasks.
One of these utilises useradd to help the support desk create users.

My problem is that if the useradd fails for any reason, the script still goes on to set passwords etc.

Useradd states: In case of an error, useradd prints an error message and exits with a non-zero status.

Which is great.. So my question is;
"How can I capture the exit code so that I can filter out what I want to do next?"
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2004
Added on Jun 29 2004
7 comments
988 views