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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to return exit with code number 4 digits?

Status
Not open for further replies.

Wrinn

MIS
Apr 30, 2001
18
HK
Dear,
As I tested, the maximum exit code value is just 256.
(Maybe I'm wrong)
if I code as
...
exit 3010
I will retrieve the value 194 from running this script.
I don't know why.
Does anyone know how to exit with code number 4 digits?
Please advise.
Regards,
 
Only the 8 least significant bits are returned with an exit. See [tt]man exit[/tt] and [tt]man -2 exit[/tt].
Cheers, Neil
 
Hi Wrinn,

It is impossible to return an exit code greater than 256.
If you specify an exit code greater than 256, the exit value will be this exit code modulo 256.

'exit 3010' and 'exit 194' give the same exit value

(3010 modulo 256 = 194). Jean Pierre.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top