Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signal_tools.bsh:trap_chain #242

Open
scott-vsi opened this issue May 13, 2020 · 0 comments
Open

signal_tools.bsh:trap_chain #242

scott-vsi opened this issue May 13, 2020 · 0 comments

Comments

@scott-vsi
Copy link
Contributor

scott-vsi commented May 13, 2020

If I run make_temp_path TMP_DIR in a just target, this line causes a trap when run via just.

last_info="$(trap '' "${2}"; trap -p "${2}" | { read x ; echo "${x##* }"; })"

Adding set -xv right before that line produces this

trap '' "${2}"; trap -p "${2}" | { read x ; echo "${x##* }"; }
++ trap '' EXIT
++ trap -p EXIT
++ read x
print_error "${BASH_SOURCE[0]}" "${LINENO}"
+++ print_error /Users/sgrichar/terra/external/vsi_common/linux/signal_tools.bsh 76
[snip]

The fix (66291fe) is simple, although why that fixes the problem is not clear:

-    last_info="$(trap '' "${2}"; trap -p "${2}" | { read x ; echo "${x##* }"; })"
+    last_info="$((trap '' "${2}"; trap -p "${2}") | { read x ; echo "${x##* }"; })"
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

No branches or pull requests

1 participant