Bash-insulter. Script that calls the user names when they enter the wrong command
Today we wanted to share a command line script, and just stumbled upon Reddit. Dating Bash-insulter, a simple script that offends users whenever they type the wrong Unix command. Using Bash-insulter, you can swear at the user for any commands typed incorrectly in his / her terminal. It will work on any Unix-like operating system that contains a BASH shell.
Bash-insulter: A script that calls the user names when entering an incorrect command
Make sure you have installed Git. If not already installed, use your default package manager to install it. For example, you can install Git using the following command on any DEB based system:
sudo apt install git
Then, from git, clone the Bash-insulter repository:
git clone https://github.com/hkbakke/bash-insulter.git bash-insulter
Copy the script to the folder / etc /…
sudo cp bash-insulter/src/bash.command-not-found /etc/
Edit the file /etc/bash.bashrc:
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 enter some wrong commands to see how he offends you.
$ unam -a $ clca
LOL! Funny, isn’t it? The author added insults that do not offend anyone. You can add your own grudges as you wish.
To do this, edit the file /etc/bash.command-not-found:
sudo vi /etc/bash.command-not-found
Add something you want in the directive local insults…
command_not_found_handle () { local INSULTS=( "Boooo!" "Разве вы не знаете что-нибудь?" "Хахаха, n00b!" "Ничего себе! Это было впечатляюще неправильно!" "Что ты делаешь??" "Жалкий" "Хуже всего сегодня!" "N00b оповещения!" "Ваша заявка на снижение зарплаты была отправлена!" "лол" "Лол ... плз" "Плз удалить" "И Премия Дарвина переходит к .... $ {USER}!" "ERROR_INCOMPETENT_USER" "Некомпетентность, какая компетентность" "Плохо." "Что это? ... Любительский час!?" "Давай! Ты можете это сделать!" "Хорошая попытка." "Что делать, если ... вы вводите фактическую команду в следующий раз!" "Что делать, если я сказал вам ... можно ввести действительные команды." "Это не для Windows" "Может быть, вы должны оставить командную строку в покое ..." "Пожалуйста, отойдите от клавиатуры!" "Код ошибки: 1D10T" "Внимание! Что-нибудь туристы и NONTEKNISCHEN LOOKENPEEPERS! KOMPUTERMASCHINE не для GEFINGERPOKEN И ЦЕНТР DIG! ODERWISE ЛЕГКО SNAP прыгающего ДВИЖЕНИЯ, BLOWENFUSEN И POPPENCORKEN LACE sparken. НЕ НЕСЕТ ОТВЕТСТВЕННОСТЬ ЗА ТОРГОВ с тупыми головками. каучук CORNERS SIGHTSEEREN KEEPEN хлопковой PICK-левши по карманам ДОЛЖНО. ZO RELAX и мигающие хлопает Lichten ". "Pro совет: введите действительную команду!" "Выйди на улицу." "Это не поисковая система." "(╯ ° □ °) ╯( ┻━┻" "¯ _ (ツ) _ / ¯" "Почему ты такой глупый?!" "Возможно, компьютеры не для вас ..." "Почему ты так со мной поступаешь?!" "Не у вас есть что-нибудь лучше сделать?!" "Я _seriously_ рассматривает 'гт -rf /' - ING себя ..." "Вот почему никто не любит вас." "Вы еще пытайтесь?!" ) # Генератор источника "случайный" 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)nn" fi echo "-bash: $1: command not found" # Возвращает код выхода, обычно возвращаемый недопустимой командой return 127 }
We’ve added some aggressive insults. See for yourself in the screenshot below.
Denial of responsibility: Neither we nor the author of this script are responsible if you hurt someone’s feelings, intentionally or accidentally. This script is purely for fun and entertainment.
Have some fun!