4 ms·
I'm working on a book about Bash scripting which is currently in the review phase, and it includes most of these. For graceful exit I recommend `trap cleanup EX
by l0b0 6y ago
I'm working on a book about Bash scripting which is currently in the review phase, and it includes most of these. For graceful exit I recommend `trap cleanup EXIT` rather than specifically trapping SIGINT, mostly because the special exit signal is triggered no matter why the script is interrupted. I wouldn't normally recommend pulling out variables into a separate files until those variables are used by more than one script. I'd be interested in the rationale for why that helps refactoring.
- heavyset_go 6y agoHave a title I can look for after the book is released?
- l0b0 6y agoThe title isn't fixed, but it'll be the first Bash book from Newline (https://www.newline.co/ https://www.newline.co/).