Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking for return value from the system command in C

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
In my C program I am calling a shell script using the system command.I want to get the return value of the shell script to check if the shell script completed successfully or not.

Can someone help me do that?

Thank you

coll2
 
you have to give the script an exit value.
exit 0 on succes and a value > 0 for an error
exit 1 or exit 5



Regards Gregor

Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top