Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
unset -v aliasRestore
if ${BASH_VERSION+\:} false; then
shopt -s extglob lastpipe
if shopt -q expand_aliases; then
shopt -u expand_aliases
aliasRestore='shopt -s expand_aliases; unset -v aliasRestore'
fi
else
aliasRestore="$(alias) ; unset -v aliasRestore"
unalias -a
fi
... function defs
${aliasRestore:+\:} eval "$aliasRestore" # crap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.