Created
May 24, 2016 21:19
-
-
Save josefdlange/851376ae09b4de5cf4247fd764e17e05 to your computer and use it in GitHub Desktop.
Manners Shell (bash only)
This file contains hidden or 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
| # 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 | |
| } |
This file contains hidden or 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
| #!/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