Page 1 of 1

We Should Have A Bash Section / Stickied Discussion Thread

Posted: 28 Sep 2011 14:48
by nitt
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.

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;

Re: We Should Have A Bash Section / Stickied Discussion Thre

Posted: 02 Nov 2011 19:00
by Rileyh
This is a batch forum, not a bash forum. Go to a linux forum and then post this there. They might actually want to have it.