I have an autosys
job. In the autosys
job I am executing a shell
script. Shell script executes indefinitely running java program. Say infinite for
loop.
#!/bin/ksh
function abc() {
java DemoJavaProgram
RESULT=$?
if[ $RESULT -eq 0 ]; then
exit 0;
else
exit 1;
}
abc | tee output.file
Above shell script is not returning anything instead it is stuck at running java program. Due to this autosys
job status is RUNNING
I tried running above command in the background with &
I had no success. I tried running an entire shell script in the background, even in this case also I had no success.
is there any way to exit from such script.
[tl;dr] I want to start the java program and exit the script
return 0
andreturn 1
in the script?if
condition is just evaluating to totrue
all the time.if-else
block from the code.