Skip to content

Instantly share code, notes, and snippets.

@josefdlange
Created May 24, 2016 21:19
Show Gist options
  • Select an option

  • Save josefdlange/851376ae09b4de5cf4247fd764e17e05 to your computer and use it in GitHub Desktop.

Select an option

Save josefdlange/851376ae09b4de5cf4247fd764e17e05 to your computer and use it in GitHub Desktop.
Manners Shell (bash only)
# Get bash-preexec first:
# curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
source ~/.bash-preexec.sh
preexec() {
python ~/.please.py
}
#!/usr/bin/env python
import sys
import random
if 'please' not in raw_input("What's the magic word? ").lower():
print random.choice([
"You should be more polite.",
"Naughty naughty!",
"Watch your manners!",
"Your mother would be ashamed.",
"Tsk tsk!"
])
sys.exit(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment