Last active
August 29, 2015 14:03
-
-
Save ormaaj/5a969c62bab8d21fe468 to your computer and use it in GitHub Desktop.
magic alias
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
bash -xO expand_aliases <<\EOF | |
alias magic='x=${BASH_COMMAND#"${BASH_ALIASES[magic]} "} command eval cmd=\$x \#' | |
magic oh hi there | |
printf 'The command that would have evaluated is: "%s"\n' "$cmd" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment