UGN Security
Posted By: Asteos Useless Bash Script - 12/03/02 05:15 AM
Okay So I Was Incredibly Bored Tonight And So I Thought I'd Just Post An Absolutely Useless Bash Program I Wrote. I Wasn't Sure Whether To Post It In "Off-Topic" "Programming" Or "*nix Security." Being as Though This Section Of The BBS Rarely Gets Traffic, I Thought I'd Post It Here.

#!/bin/bash
declare Name="1"
while [ "$Name" -eq "1" ]
do
clear
echo ""
echo "What's Mah Name, [censored]!?"
echo ""
echo "1. [censored] If I Know"
echo "2. Asteos, The Master Of The Linux Dojo"
echo ""
echo "Enter You Selection: "
read Name
done
echo "Damn StraighT!!"

So If You Don't Type The Second Selection Nothing Is Supposed To Happen laugh So You're Basically Forced To Call Me The Master Or You Don't go Anywhere. Well, Almost Anywhere. If You Type Any Number Other Than One It Will Echo "Damn StraighT!!" Pretty funny, I Thought. I'm Not The Linux-Dojo-Master Just Yet, Or I Would Have Made This Do Much More, But Just In Good fun. Oh Well confused
Posted By: Infinite Re: Useless Bash Script - 12/03/02 06:26 AM
Hehe. You started this topic so...

You should change the operator in the while statment to force the person to say are you are the [censored]. eg:

#!/bin/bash
declare Name="1"
while [ "$Name" != "2" ]
do
clear
echo ""
echo "What's Mah Name, [censored]!?"
echo ""
echo "1. [censored] If I Know"
echo "2. Asteos, The Master Of The Linux Dojo"
echo ""
echo "Enter You Selection: "
read Name
done
echo "Damn StraighT!!"
Posted By: Asteos Re: Useless Bash Script - 12/04/02 03:27 AM
Hell Yeh! It Worked. I Don't Get It Though, You Changed The Value of $Name to 1, but Then Within The While Loop You Just Added A "!="2"" What does "!" Stand for?
Posted By: spectre Re: Useless Bash Script - 12/05/02 12:14 AM
!= means Does not equal. So basically, while name does not equal 2, keep looping, which forces the user to press 2.
Posted By: hKzKnight Re: Useless Bash Script - 12/05/02 12:28 AM
LOL very intresting, does show a person who is bored. Still trying to figure if this should stay in *nix or be in programming, bah i'll keep it.
© UGN Security Forum