Created
March 6, 2021 19:01
-
-
Save rrbutani/4bd197cb50cc0d8266fe6a84cd185e5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function instrument { | |
local state e | |
state=$(set +o | xargs -L1 echo ' ') # prefix with spaces so these don't pollute the history | |
set -x | |
"${@}"; | |
{ e=$?; set +x; } 2>/dev/null | |
eval "${state}" | |
return $e | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment