Ok so I got a little bored and desided to make a fun little bash script that you can use to scare Linux neewbies
Here is the code:
Quote:
#!/bin/bash
clear
echo "Formating disk(s): " /dev/sd*
sleep 2
echo "Initialising..."
sleep 2
echo "Are you sure you want to format these disks?"
# Declare variable choice and assign value 3
choice=3
# Print to stdout
echo "1. Yes"
echo "2. No"
echo -n "Please choose Yes or No? "
# Loop while the variable choice is equal 3
# bash while loop
while [ $choice -eq 3 ]; do
# read user input
read choice
#bash nested if/else
if [ "$choice" == "1" ] ; then
echo "Yes"
sleep 1
echo "Ok, formating starts in 5 seconds"
sleep 1
echo "4 seconds"
sleep 1
echo "3 seconds"
sleep 1
echo "2 seconds"
sleep 1
echo "1 seconds"
sleep 1
for i in {1..50000}
do
echo -n -e "\033[1m${color}0\033[0m"
done
sleep 1
echo ""
echo /dev/sd* "are formatted."
else
if [ "$choice" == "2" ] ; then
sleep 1
echo "Yes"
sleep 1
echo "Ok, formating starts in 5 seconds"
sleep 1
echo "4 seconds"
sleep 1
echo "3 seconds"
sleep 1
echo "2 seconds"
sleep 1
echo "1 seconds"
sleep 1
for i in {1..50000}
do
echo -n -e "\033[1m${color}0\033[0m"
done
sleep 1
echo ""
echo /dev/sd* "are formatted."
else
echo "Please choose Y or N? "
echo "1. Y"
echo "2. N"
echo -n "Please choose Y or N? "
choice=3
fi
fi
echo "All disk(s) now formatted rebooting in 5 seconds..."
sleep 1
echo "4"
sleep 1
echo "3"
sleep 1
echo "2"
sleep 1
echo "1"
sleep 1
echo "..................................."
sleep 1
echo "Shutting down now"
done
|
paste it into any old text editor save as "fun.sh" right click go to properties make executable and then in terminal type "./fun.sh"
Have fun scaring people!!