Last active
December 1, 2022 11:17
-
-
Save lhns/6eca7b1ae27d9df9e7bf5be8d8ba15ce to your computer and use it in GitHub Desktop.
This file contains 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
exec {SUBSHELL_STDOUT_FD}>&1; eval "$({ | |
set -e | |
trap 'while IFS= read -r SUBSHELL_VAR; do SUBSHELL_VAL="${!SUBSHELL_VAR}"; [[ "$SUBSHELL_VAR" != SUBSHELL_VAR ]] && [[ "$SUBSHELL_VAR" != SUBSHELL_VAL ]] && [[ "$SUBSHELL_VAR" != SUBSHELL_STDOUT_FD ]] && [[ "$SUBSHELL_VAR" != SUBSHELL_VARS_FD ]] && unset "$SUBSHELL_VAR" 2> /dev/null && printf "%q=%q\\n" "$SUBSHELL_VAR" "$SUBSHELL_VAL" || true; done < <(compgen -v) >&${SUBSHELL_VARS_FD}' EXIT | |
test=asdf6 | |
echo output | |
false | |
} {SUBSHELL_VARS_FD}>&1 >&${SUBSHELL_STDOUT_FD}-)"; exec {SUBSHELL_STDOUT_FD}<&- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment