Change script variable value via Java application

1

I created a script where within this script there is a loop of type while . The condition of this while is escolha != 1 . Everything works ok, but in the middle of this while I run a Java application where I make some checks and depending on that check I need to change the value of this variable to 1 to be able to exit the loop. Is there any way to do this? I've tried it this way:

    
asked by anonymous 18.07.2015 / 08:12

1 answer

1

In script you will do this:

retorno = $(java -jar VerificaSolucao.jar $numCorA A)

Use the variable retorno in if .

In Java you will change the line where you try to change a variable that does not exist there and returns the desired value . In else you will do this:

System.exit(1);

Do not forget to flag 0 in if , after all you should always flag something, no matter how Java runs. I do not know if Java sends 0 by default if it does not flag anything.

Actually the convention is return 0 when everything works fine and a negative number when there is a problem.

I would put the whole code if you had posted it instead of image.

    
18.07.2015 / 13:55