Skip to content

Instantly share code, notes, and snippets.

@rm1984
Created July 8, 2017 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rm1984/7f99aef3ba53402495d8475fc948acc2 to your computer and use it in GitHub Desktop.
Save rm1984/7f99aef3ba53402495d8475fc948acc2 to your computer and use it in GitHub Desktop.
Checks if a dumb user writes a command in uppercase
export PROMPT_COMMAND='echo "$(history 1 | cut -c 8-)" >> /tmp/.cmds ; FULLCMD=$(tail -1 /tmp/.cmds) ; FIRSTCMD=$(echo "$FULLCMD" | cut -d" " -f1) ; if [ -z $(echo $FIRSTCMD | tr -d "[:upper:]") ]; echo "*** WHY DAFUQ ARE YOU SHOUTING?!? ***" ; fi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment