3 ms·
The canonical example is this: Imagine an installer script that runs a buildscript and then cleans up after itself. So somewhere in the depth of it there is th
by yoo1I 10y ago
The canonical example is this:
Imagine an installer script that runs a buildscript and then cleans up after itself. So somewhere in the depth of it there is the command rm /home/gonzales/.build/foo, but the network connection cut's out just after /home/gonzales so the last thing that the interpreter sees is rm /home/gonzales and well ... there you go.
Stranger things have happened.
- ash 10y agoIt's a valid concern. The solution is to wrap the whole script in a bash function executed on the last line.
- lucb1e 10y agoWhich, it should be noted, is also typical. I'm sure you can find many examples that don't if you go looking for it, but most I've seen do this, especially in recent years.
- comboy 10y agoYou could prepare your script in a way that it only executes once everything is downloaded (big string then eval or smthg). If you would that and use https is there anything else to worry about? I mean I do prefer to view the script before executing it, but theoretically.
- deleted 10y ago[deleted]