Created
January 9, 2015 07:48
-
-
Save dualbus/87ee24145896b4e2d250 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
#!/bin/bash | |
shopt -s extdebug extglob | |
k0ud3() { | |
local cmd=$1 | |
case $cmd in | |
+([[:digit:]])@([*+/-])+([[:digit:]])):;; | |
*)! :;; | |
esac && eval echo "$(($cmd))" | |
} | |
trap 'k0ud3 "$BASH_COMMAND"; ! :' DEBUG |
shopt -s extdebug; trap '(echo $((BASH_COMMAND))) 2>/dev/null; ! :' DEBUG ^_^
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
k0ud3() (echo$(($ *))) 2>/dev/null