Aujourd'hui, je suis tombé sur un script de ligne de commande amusant nommé Bash-insulter . Le script Bash-insulter insulte les utilisateurs lorsqu'ils tapent une mauvaise commande. En utilisant bash-insulter, vous pouvez mettre les utilisateurs mal à l'aise en affichant des mots amusants et insultants lorsqu'ils exécutent une commande mal orthographiée dans le terminal. Il fonctionnera sur tous les systèmes d'exploitation de type Linux et Unix qui contiennent BASH Shell version 4 et plus récente et Zsh.
Le script bash-insulter insulte les utilisateurs lorsqu'ils tapent une mauvaise commande
Assurez-vous d'avoir installé Git . S'il n'est pas déjà installé, utilisez votre gestionnaire de packages par défaut pour l'installer. Par exemple, vous pouvez installer GIT à l'aide de la commande suivante dans n'importe quel système basé sur DEB :
$ sudo apt install git
Ensuite, git clonez le dépôt Bash-insulter :
$ git clone https://github.com/hkbakke/bash-insulter.git bash-insulter
Copiez le script dans votre /etc/ dossier.
$ sudo cp bash-insulter/src/bash.command-not-found /etc/
Modifier /etc/bash.bashrc
fichier :
$ sudo vi /etc/bash.bashrc
Ajoutez les lignes suivantes :
if [ -f /etc/bash.command-not-found ]; then . /etc/bash.command-not-found fi
Appuyez sur ESC clé et tapez :wq
pour enregistrer et fermer le fichier.
Enfin, exécutez la commande suivante pour mettre à jour les modifications.
$ source /etc/bash.bashrc
Maintenant, tapez une mauvaise commande pour voir comment cela vous insulte.
$ unam -a $ clca

Bash-insulter insulte les utilisateurs lorsqu'ils tapent une mauvaise commande
MDR! Drôle, n'est-ce pas ? L'auteur du scénario a ajouté des insultes qui n'offusquent pas grand-chose. Vous pouvez cependant ajouter vos propres insultes à votre guise.
Pour ce faire, modifiez /etc/bash.command-not-found
fichier :
$ sudo vi /etc/bash.command-not-found
Ajoutez quelque chose comme vous le souhaitez dans les insultes locales directives.
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 }
J'ai ajouté quelques insultes agressives. Voyez-vous dans la capture d'écran ci-dessous.

Insulter les utilisateurs lors de la saisie d'une mauvaise commande à l'aide de Bash-insulter
Avis de non-responsabilité : Ni nous ni l'auteur de ce script ne sommes responsables si vous avez offensé les sentiments de quelqu'un, intentionnellement ou accidentellement en utilisant ce script. Ce script est purement à des fins de divertissement et de divertissement. Amusez-vous !