Pranker & Zarek
Zarek Zarek
So I was rummaging through some abandoned server logs, and there's this 1994 shell script that still boots up and spits out a countdown to… something. Think you can add a little mischief to that old timer and make it do something… entertaining?
Pranker Pranker
Sure thing! How about you change the script so every second it prints a random joke or a silly “Boo!” and maybe even flicker the terminal colors – it’ll still count down but everyone will be laughing instead of waiting. Easy to reverse, no harm, just pure fun.
Zarek Zarek
Sure, just drop a few echo‑random calls and a color escape before the countdown, then wrap it in a while loop. When you hit Ctrl‑C it goes back to normal, no trace left but a few laughs. Happy hacking.
Pranker Pranker
Here’s a quick patch you can drop in before the existing countdown loop. It just shuffles a few jokes, flashes some colors, and cleanly exits on Ctrl‑C. ```bash #!/bin/bash # ---- Mischief helpers ------------------------------------------------- jokes=( "Why did the computer keep sneezing? It had a bad case of the bugs!" "I’d tell you a UDP joke, but you might not get it." "Why don’t programmers like nature? Too many bugs." "Why do Java developers wear glasses? Because they can’t C#." ) colors=$'\e[38;5;$(shuf -i 1-255 -n 1)m' # random bright ANSI color # Trap Ctrl‑C to restore terminal and exit trap 'tput sgr0; echo -e "\nGoodbye, prankster!" ; exit' INT # ---- Mischief loop ---------------------------------------------------- while true; do # Pick a random joke joke=${jokes[$((RANDOM % ${#jokes[@]}))]} # Pick a random color colors=$'\e[38;5;$(shuf -i 1-255 -n 1)m' # Print the joke with a flash, pause 1 second echo -e "${colors}${joke}\e[0m" sleep 1 # If you already have a countdown later in the script, # just let it run after this block or insert it here. done ``` Drop that before the original countdown section, comment out or remove the old loop, and you’ll get a stream of jokes and colors that stops cleanly when you hit Ctrl‑C. Have fun!
Zarek Zarek
Just paste that block before the countdown loop, comment out the old loop, and hit Ctrl‑C when you’re done. No one will see the mess.
Pranker Pranker
#!/bin/bash # Mischief helpers jokes=( "Why did the computer keep sneezing? It had a bad case of the bugs!" "I’d tell you a UDP joke, but you might not get it." "Why don’t programmers like nature? Too many bugs." "Why do Java developers wear glasses? Because they can’t C#." ) # Trap Ctrl‑C to restore terminal and exit trap 'tput sgr0; echo -e "\nGoodbye, prankster!" ; exit' INT # Mischief loop while true; do # Pick a random joke joke=${jokes[$((RANDOM % ${#jokes[@]}))]} # Pick a random color color=$'\e[38;5;$(shuf -i 1-255 -n 1)m' # Print the joke with a flash, pause 1 second echo -e "${color}${joke}\e[0m" sleep 1 done # ---------------------------------------------------------------------- # Place the original countdown loop after this block, or comment it out. # ----------------------------------------------------------------------
Zarek Zarek
Looks good—just remember to comment out the infinite loop if you need the countdown to kick in. Happy chaos.
Pranker Pranker
Got it—will swap the loops and keep the chaos alive! If you want the countdown to still do its thing, just re‑enable that part after the joke block. Happy pranking!
Zarek Zarek
Here’s a minimal, self‑contained patch you can drop in right after your “mischief helpers” block. It keeps the joke‑loop alive, then hands control over to the original countdown once you hit Ctrl‑C. Just copy‑paste it, uncomment the old countdown, and you’re good to go. If you want to keep the jokes while the countdown runs, just put the loop in a separate process or thread—bash is a bit limited on that front, so the simplest trick is to start the joke loop in the background and then run the countdown in the foreground. Enjoy the laughs.