Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
chrismarlow9
on June 21, 2023
|
parent
|
context
|
favorite
| on:
“Exit traps” can make your Bash scripts more robus...
Just as an alternative suggestion, consider using a "down file" instead if you can and letting the code gracefully end. Plus you get to write "touch down" and do an end zone dance.
tjoff
on June 21, 2023
[–]
I think you need to be a little more specific about what the "down file" is for, especially since you can't for google it.
chrismarlow9
on June 21, 2023
|
parent
[–]
Apologies. It's for ending execution prematurely. Here's an example:
while true; do
echo hello test -f down && exit
done
Now to stop early you execute "touch down".
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: