Oggi mi sono imbattuto in un divertente script da riga di comando chiamato Bash-insulter . Lo script Bash-insulter insulta gli utenti quando digitano un comando sbagliato. Usando bash-insulter, puoi mettere a disagio gli utenti visualizzando parole divertenti e offensive quando eseguono un comando errato nel Terminale. Funzionerà su qualsiasi sistema operativo simile a Linux e Unix che contiene BASH Shell versione 4 e successive e Zsh.
Lo script Bash-insulter insulta gli utenti quando digitano un comando sbagliato
Assicurati di aver installato Git . Se non è già installato, usa il tuo gestore di pacchetti predefinito per installarlo. Ad esempio, puoi installare GIT utilizzando il seguente comando in qualsiasi sistema basato su DEB:
$ sudo apt install git
Quindi, git clona il repository Bash-insulter:
$ git clone https://github.com/hkbakke/bash-insulter.git bash-insulter
Copia lo script nel tuo /etc/ cartella.
$ sudo cp bash-insulter/src/bash.command-not-found /etc/
Modifica /etc/bash.bashrc
file:
$ sudo vi /etc/bash.bashrc
Aggiungi le seguenti righe:
if [ -f /etc/bash.command-not-found ]; then . /etc/bash.command-not-found fi
Premi ESC digitare e digitare :wq
per salvare e chiudere il file.
Infine, esegui il comando seguente per aggiornare le modifiche.
$ source /etc/bash.bashrc
Ora, digita un comando sbagliato per vedere come ti insulta.
$ unam -a $ clca

Bash-insulter insulta gli utenti quando digitano un comando sbagliato
LOL! Divertente, no? L'autore della sceneggiatura ha aggiunto degli insulti che non offendono molto nessuno. Puoi, tuttavia, aggiungere i tuoi insulti come desideri.
Per farlo, modifica /etc/bash.command-not-found
file:
$ sudo vi /etc/bash.command-not-found
Aggiungi qualcosa come desideri negli insulti locali direttiva.
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 }
Ho aggiunto alcuni insulti aggressivi. Vedi te stesso nello screenshot qui sotto.

Insulta gli utenti quando digitano un comando sbagliato utilizzando Bash-insulter
Disclaimer: Né noi né l'autore di questo script siamo responsabili se hai offeso i sentimenti di qualcuno, utilizzando intenzionalmente o accidentalmente questo script. Questa sceneggiatura è puramente a scopo di divertimento e intrattenimento. Buon divertimento!