We Should Have A Bash Section / Stickied Discussion Thread
Posted: 28 Sep 2011 14:48
Because Batch is Windows, and then Linux and Mac both use Bash. Which isn't too different. But I think it would just be neat to have this.
OR.
A section for suggesting ideas.
OR.
A section for suggesting ideas.
Code: Select all
#!/bin/bash
function getRan {
ran=$(($RANDOM % $1 + 1));
}
function check {
input=$(($input));
if [ $input \> $ran ]; then
echo "Too high!";
fi
if [ $input \< $ran ]; then
echo "Too low!";
fi
if [ $input == $ran ]; then
echo "Correct!";
read -p "Press return to continue . . .";
getRan 100;
clear;
fi
start;
}
function start {
read input;
check $input;
start;
}
getRan 100;
start;