3 ms·
If curl dies early, bash might be executing a truncated script. Arbitrarily truncated bash scripts are often valid bash scripts that do things you don't want.
by dllthomas 4y ago
If curl dies early, bash might be executing a truncated script. Arbitrarily truncated bash scripts are often valid bash scripts that do things you don't want.
- nhooyr 4y agoYou can trivially sidestep this with a main shell function called at the end of your script. https://github.com/terrastruct/d2/blob/729b12685af79bbdaf4b3602f359a16a7971d31a/ci/release/_install.sh#L512 https://github.com/terrastruct/d2/blob/729b12685af79bbdaf4b3...
- dllthomas 4y agoKinda! The author of the script can trivially avoid the problem. The person pasting "curl ... | bash" into their terminal needs to rely on them having done so, which (last I looked) they too often haven't.