If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Handling negative return code value in ksh

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-04-02, 10:31
emilia emilia is offline
Registered User
 
Join Date: Jun 2002
Posts: 1
Question 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
Reply With Quote
  #2 (permalink)  
Old 08-20-02, 04:22
WingMan WingMan is offline
Registered User
 
Join Date: Aug 2002
Location: UK
Posts: 87
can you do something like ... ??


integer i=254
integer ReturnValue=0

${ReturnValue} = ${i} - $?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On