Getting Exit Value

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting Exit Value

rameshj
Hi,

I am developing a CLI client using bean shell script. I require some help on the bean shell script.  I am facing an issue in getting exit value in the calling script. I am performing Sysgem.exit(1001) from my code. But I am getting exit value as 233. I am expecting to get 1001 instead of 233. I appreciate your help on this.

Following are my script snippet.

while (true)
do
$JAVA_HOME/bin/java -cp $CLASS_PATH  bsh.Interpreter $1

CLI_EXIT_VALUE=$?
echo "exit value-->"$CLI_EXIT_VALUE
if [ $CLI_EXIT_VALUE -ne 1001 ]
then
        exit $CLI_EXIT_VALUE
fi
done



Thanks,
Ramesh


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exit Value

Felix Plesoianu
--- J Ramesh Kumar <[hidden email]> wrote:

> I am performing Sysgem.exit(1001) from
> my
> code. But I am getting exit value as 233.

You may want to remember that on Unix systems the exit code is one
byte, i.e. 0-255. The fact that it's a Java application can't change
that. It appears that larger values do wrap around, though.

Regards,
Felix



       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/ 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: Getting Exit Value

rameshj
Felix,

Thanks for your immediate help. It works.

Regards,
Ramesh


Felix Plesoianu wrote:
--- J Ramesh Kumar [hidden email] wrote:

  
I am performing Sysgem.exit(1001) from
my 
code. But I am getting exit value as 233.
    

You may want to remember that on Unix systems the exit code is one
byte, i.e. 0-255. The fact that it's a Java application can't change
that. It appears that larger values do wrap around, though.

Regards,
Felix



       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users

  


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users