I have a script that calls a JAR file:
exec("$java_path/java -jar testjar.jar --username user --password pswd");
or
system("$java_path/java -jar testjar.jar --username user -password pswd");
I need to return the error code from the JAR file. Exec
does this on Linux, but not on Windows. This seems to be a bug in Perl... I found it in Stack Overflow question Return code using exec is not coming back.
I started using exec, but after getting the answer from that Stack Overflow question I started using the workaround posted by ikegami. However, now my issue is that when using system
the process is in the process table with the arguments showing (the main issue being the password).
I am looking for a solution where I can both get the return code and hide the password from the process table.