4 ms·
Please tell me it's enough to check the exit code! That's all I ever do and I have hundreds of mktemp scripts out there. In the end I think shelling is mostly
by emj 7y ago
Please tell me it's enough to check the exit code! That's all I ever do and I have hundreds of mktemp scripts out there.
In the end I think shelling is mostly about controlling your inputs.
- clarry 7y agoNot just inputs, unfortunately. TOCTOUs (and races in general), for instance, are very common problem in shell scripts.
- arpa 7y agoRaces and TOCTOUs are generally common problems in most concurrent systems that are not considering atomicity by design (e.g. rdbms). It's just that shell can very easily become concurrent...
- TheDong 7y agoYes, it's enough to check the exit code. The parent poster's being overly paranoid. The only thing that checking the exit code won't catch is bugs in mktemp/bash, or bad memory / solar flare bitflips.