Help save net neutrality! Learn more.
Close

RC = (0-255) on linux, why?

Help
Anonymous
2003-10-21
2004-01-27
  • Anonymous - 2003-10-21

    Why am I only able to use return codes of 0-255 on the linux platform?  Is RC stored as a byte or unsigned short internally?  (why?)  Am I doing something wrong, or is there a change I can make to a Rexx or Linux environment setting to change this behavior?

    I have literally thousands of return codes that I make use of on Windows platforms but these values can not port to my Linux platform.

    Please advise...

     
    • Anonymous - 2003-10-21

      hmm...  I also see that $? = 255 when I return -1 from my program.  This leads me to think this is a Linux thing.

      Any suggestions or workarounds you can suggest would be greatly appreciated.

       
      • Robert A "Bob" Cruz

        I don't think there is a simple workaround.  I was faced with the same situation under DOS, which also uses 1-byte return codes (DOS calls them "Error Level"s).

        You could switch to some other OS ;-)

        Seriously, you'd have to pass the necessary information using some other mechanism:  perhaps store it in a file or set an environment variable.

         
    • Ross Patterson

      Ross Patterson - 2004-01-25

      Unix programs are limited to return codes (they call them "exit status") in the range 0-255.  It's a tradition of very long standing.

      Ross A. Patterson
      CatchFIRE Systems, Inc.
      Ross.Patterson@CatchFS.Com

       

Log in to post a comment.