Created
August 10, 2013 16:35
-
-
Save chuckwagoncomputing/6201089 to your computer and use it in GitHub Desktop.
Hacker Mode - source from your bash profile
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
hackermode() | |
{ | |
if [ "$1" == "on" ]; then | |
shopt -s extdebug | |
analyzer () | |
{ | |
LAST=`fc -ln -1 | cut -d " " -f 2` | |
if which $LAST &> /dev/null; then | |
which $LAST | |
elif type $LAST | grep builtin &> /dev/null; then | |
type $LAST | grep builtin | |
elif type $LAST | grep function; then | |
type $LAST | grep function | |
declare -F $LAST | |
else | |
: | |
fi | |
} | |
PROMPT_COMMAND="analyzer" | |
elif [ "$1" == "off" ]; then | |
shopt -u extdebug | |
unset PROMPT_COMMAND | |
else | |
echo "USAGE: hackermode [off || on]" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment