Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2002
    Posts
    1

    Question Unanswered: Handling negative return code value in ksh

    I am running a third party program from within a korn shell script (aix 5.1).
    The program returns zero, positive and negative return code values but the negative ones are represented as positive integers in the $? return code variable. For example -1 becomes 255, -2 becomes 254 etc.

    My script needs to convey these return codes (to a calling process) as a true negative value (ie a value that that will actually test negative). Is there any way to do this (preferably within a shell script) ?

    I hope someone can help

    With Thanks

    Emilia

  2. #2
    Join Date
    Aug 2002
    Location
    UK
    Posts
    87
    can you do something like ... ??


    integer i=254
    integer ReturnValue=0

    ${ReturnValue} = ${i} - $?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •