5

Is it safe to remove a script file from within that script?

view full story
linux-howto

http://unix.stackexchange.com – Imagine I have a script foo. It should be run once when the user logs in and isn't needed after a successful run. My question: Is it safe to remove the script file from within the script? E.g.: #!/bin/bash # do something ... # if successful rm /path/to/foo exit 0 (HowTos)