Can we define exit status intereger values for our purpose except 0?

like can i set custom exit status messages:

"1" for error occured because of reason #1
"2" for error occured because of reason #2
...

Is there any document which displays all the exit status code values from 0-255?

Recommended Answers

All 3 Replies

There are no system wide standard exit codes other than 0 is success
and other than 0 is generally regarded as an error. It is completely up
to you how you want to handle exit codes.

Granted, you should not use those codes, but you also do not need to attempt to handle these conditions for yourself either. The system/shell will generally take care of these for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.