I have written a bash function in my .bashrc
which is responsible for updating my java jar file and restarting the application with the new jar, as an auto-updating mechanism.
I am trying to use the following java snippet to execute my function from my java code:
Runtime.getRuntime().exec(new String[] { "/bin/bash", "-c", "update-logbot" });
This returns an exit code of 127
, indicating that it cannot find the function.
How would I accomplish executing this bash function from the java application?