Skip to content

Append instead of overriding trap handler (fixes #6)#7

Open
dcsobral wants to merge 1 commit intocoryb:masterfrom
dcsobral:bug/trapHijacking
Open

Append instead of overriding trap handler (fixes #6)#7
dcsobral wants to merge 1 commit intocoryb:masterfrom
dcsobral:bug/trapHijacking

Conversation

@dcsobral
Copy link

@dcsobral dcsobral commented Jul 1, 2019

Also fixes a missing triple quote on README.

Introduces OSHT_TRAP_OVERRIDE to revert to previous behavior, as a way to avoid pre-existing trap handlers that exit. I'd normally prepend instead of append to avoid that issue, but OSHT trap handler calls exit, which prevents other handlers from running.

@gaspardpetit
Copy link

When I tried this on my end, bash -c "echo $(trap -p INT TERM EXIT)" returns nothing, so trap -- "${3}${3:+;}${HANDLER}" ${SIGNALS} then fails with osht.sh: line 108: 3: unbound variable

I imagine trap -p is supposed to return something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants