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

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

By sk
120 Views

Today I stumbled upon an interesting command line script named Bash-insulter. This script insults the user whenever s/he types a wrong Unix command. Using bash-insulter, you can make the users uncomfortable by displaying funny and insulting words when they run a misspelled command in the Terminal. It will work on any Unix-like operating systems that contains BASH Shell version 4 and newer and Zsh.

Bash-insulter Script 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

Bash-insulter Script Insults The User When Typing Wrong Command

LOL! Funny, isn't? The author has added the insults that doesn't offend much any one. You can, however, 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 we nor the author of this script are responsible if you offended someone's feelings, intentionally or accidentally using this script. This script is purely for fun and entertainment purpose. Have fun!

Resource:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

2 comments

waris November 17, 2018 - 12:18 am

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

NOT A VALID URL
does NOT WORK.

Reply
sk November 17, 2018 - 9:55 am

I just checked it. It works for me.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More