Skip to content

Instantly share code, notes, and snippets.

@ormaaj
Last active October 19, 2015 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ormaaj/18b956881b2c8bc493ad to your computer and use it in GitHub Desktop.
Save ormaaj/18b956881b2c8bc493ad to your computer and use it in GitHub Desktop.
Magic test
#!/bin/bash
shopt -s expand_aliases extglob
alias \[='x=${BASH_COMMAND#"${BASH_ALIASES[\[]} "} command eval eval \"[[ \$x]\" \#'
set -x
[ ormaaj == or+([ma])j ]
echo "$?"
+ x='ormaaj == or+([ma])j ]'
+ command eval eval '"[[' '$x]"' '#' ormaaj == 'or+([ma])j' ']'
+ eval eval '"[[' '$x]"' '#' ormaaj == 'or+([ma])j' ']'
++ eval '[[ ormaaj == or+([ma])j ]]'
+++ [[ ormaaj == or+([ma])j ]]
+ echo 0
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment