Matt James1 wrote:
I know this is a pretty basic question, I am very new to shell scripting and I am looking for information on how to write a self destructing script. basically, I want the script to run, exit terminal and then delete it's self.
I think it would help if you gave more detail about what you want. For example, there's a difference between a
script and a
process. A script is a text document that contains some high-level commands in a given language (usually bash or tch for unix commands). A process is what you get when you run (execute) a script - the computer translates the text commands in the script file into low-level computer commands, and then creates and executes those commands. it's like the difference between a musical score (music written on paper) and the the same music played on instruments. most processes are self-terminating (unless they are built with endless loops of some sort), so nothing special normally needs to be done to 'delete' a process. scripts are text files, and you can delete them if you want, but that's not normal (since you usually want to run a script again at some point in the future).