Skip to content

Instantly share code, notes, and snippets.

@soberstadt
Last active May 7, 2016 00:49
Show Gist options
  • Save soberstadt/0a8bf7ed787fef046d6f7686d62dc5ef to your computer and use it in GitHub Desktop.
Save soberstadt/0a8bf7ed787fef046d6f7686d62dc5ef to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Happy Birthday, Jordan! I hope this can help make your day extra special!
# so this will make your Terminal's "Command not found" messages a little
# more fun. Examples:
# $ bundler install
# bundler? I hardly know her!
# $ gem spec
# What is this gem you speak of?
# install by dumping somehwhere like ~/bin and then activate with adding
# `source ~/bin/silly_command_not_found.sh` to either .bashrc or .zshrc
silly_not_found() {
local cmd="$1"
if [[ "$cmd" =~ .+er$ ]]
then
echo "$cmd? I hardly know her!"
else
echo "What is this $cmd you speak of?"
fi
}
if [ -n "$BASH_VERSION" ]; then
command_not_found_handle() {
silly_not_found $*
return $?
}
elif [ -n "$ZSH_VERSION" ]; then
command_not_found_handler() {
silly_not_found $*
return $?
}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment