Skip to content

Instantly share code, notes, and snippets.

@chuckwagoncomputing
Created August 10, 2013 16:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckwagoncomputing/6201089 to your computer and use it in GitHub Desktop.
Save chuckwagoncomputing/6201089 to your computer and use it in GitHub Desktop.
Hacker Mode - source from your bash profile
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