I am running bash scripts from java programs on a server. I just uploaded a new version of the script intending the next run of the script to use the version. I did not mean
Upon invocation, bash will fork off a new process and load the script into memory. Unless the script references itself, it should still work. Here is an example of a script both deleting itself from disk and still working until it tries to access itself via $0
#!/bin/bash
echo "I can't take it anymore"
echo "Goodbye World!"
rm -f "$0"
echo "Wait, I change my mind!"
sed 's/Goodbye/Hello/' "$0"
$ ./suicide.sh
I can't take it anymore
Goodbye World!
Wait, I change my mind!
sed: can't read ./suicide.sh: No such file or directory