Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
JohnMakin
on June 20, 2023
|
parent
|
context
|
favorite
| on:
“Exit traps” can make your Bash scripts more robus...
I like to use these in combination with set -e and report the error that happened to whatever is capturing stdout for logging.
You can report the error code with $? at the start of your trap, IIRC.
Consider applying for YC's W25 batch! Applications are open till Nov 12.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
You can report the error code with $? at the start of your trap, IIRC.