Re:Techniques I Use to Create a Great User Experience for Sh...
by 0xbadcafebee on Sunday September 15, 2024 @12:14AM
(#41545161)
[delayed]
[ Parent
| on HN ]
Re:Techniques I Use to Create a Great User Experience for Sh...
by ndsipa_pomu on Sunday September 15, 2024 @08:23AM
(#41547079)
> the script exited with an error. But it didn't tell you that.
Yes it did, by having a non-zero exit code. However, it didn't explicitly mention that it didn't complete successfully, but that's down to the script writer. I like to include a function to tidy up temporary files etc. when the script exits (e.g. trap __cleanup_before_exit EXIT) and it's easy to also assign a function to run when ERR is triggered - if you wish, you can set it to always provide an error backtrace.