Bash-insulter : A Script That Insults The User When Typing Wrong Command

Bash-insulter

Today I would like to share a command line script that I just came across on Reddit. Meet Bash-insulter, a simple script that insults the user whenever s/he types a wrong Unix command. Using bash-insulter, you can embarrass the user for any mistyped commands in his/her Terminal. It will work on any Unix-like operating systems that contains BASH Shell.

Bash-insulter : A Script That Insults The User When Typing Wrong Command

Make sure you have installed Git. If it is not installed already, use your default package manager to install it. For example, you can install GIT using the following command in any DEB based system:

sudo apt install git

Then, git clone the Bash-insulter repository:

git clone https://github.com/hkbakke/bash-insulter.git bash-insulter

Copy the script to your /etc/ folder.

sudo cp bash-insulter/src/bash.command-not-found /etc/

Edit /etc/bash.bashrc file:

sudo vi /etc/bash.bashrc

Add the following lines:

if [ -f /etc/bash.command-not-found ]; then
    . /etc/bash.command-not-found
fi

Save and close the file by typing :wq.

Finally run the following command to update the changes.

source /etc/bash.bashrc

Now, type some wrong command to see how it insults you.

$ unam -a

$ clca

LOL! Funny, isn’t? The author has added the insults that doesn’t offend much any one. You can add your own insults as you wish.

To do so, edit /etc/bash.command-not-found file:

sudo vi /etc/bash.command-not-found

Add something as you wish within local insults directive.

command_not_found_handle () {
 local INSULTS=(
 "Boooo!"
 "Don't you know anything?"
 "RTFM!"
 "Hahaha, n00b!"
 "Wow! That was impressively wrong!"
 "What are you doing??"
 "Pathetic"
 "The worst one today!"
 "n00b alert!"
 "Your application for reduced salary has been sent!"
 "lol"
 "u suk"
 "lol... plz"
 "plz uninstall"
 "And the Darwin Award goes to.... ${USER}!"
 "ERROR_INCOMPETENT_USER"
 "Incompetence is also competence"
 "Bad."
 "Fake it till you make it!"
 "What is this...? Amateur hour!?"
 "Come on! You can do it!"
 "Nice try."
 "What if... you type an actual command the next time!"
 "What if I told you... it is possible to type valid commands."
 "Y u no speak computer???"
 "This is not Windows"
 "Perhaps you should leave the command line alone..."
 "Please step away from the keyboard!"
 "error code: 1D10T"
 "ACHTUNG! ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS! DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN. IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS. ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN."
 "Pro tip: type a valid command!"
 "Go outside."
 "This is not a search engine."
 "(╯°□°)╯︵ ┻━┻"
 "¯\_(ツ)_/¯"
 "So, I'm just going to go ahead and run rm -rf / for you."
 "Why are you so stupid?!"
 "Perhaps computers is not for you..."
 "Why are you doing this to me?!"
 "Don't you have anything better to do?!"
 "I am _seriously_ considering 'rm -rf /'-ing myself..."
 "This is why you get to see your children only once a month."
 "This is why nobody likes you."
 "Are you even trying?!"
 )

# Seed "random" generator
 RANDOM=$(date +%s%N)
 VALUE=$((${RANDOM}%2))

if [[ ${VALUE} -lt 1 ]]; then
 printf "\n $(tput bold)$(tput setaf 1)$(shuf -n 1 -e "${INSULTS[@]}")$(tput sgr0)\n\n"
 fi

echo "-bash: $1: command not found"

# Return the exit code normally returned on invalid command
 return 127
}

I have added some aggressive insults. See yourself in below screenshot.

Disclaimer: Neither I nor the author of this script are responsible if you have offended someone’s feelings, intentionally or accidentally. This script is purely for fun and entertainment.

Have fun!

Resource:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You may also like...