Hi,
I have an assignment for my Unix class to write a program asking a user to enter a number. the user then chooses an option from a menu of whether they want to count down to zero from the number they entered, or count up from zero to the number. The error i keep getting is binary operator expected for lines 9 and 14 , than when i change that it says unary operator expected. Also I want to know if I coded this whole thing corretly. any ideas?
Code:
echo "Enter a number"
read $number
echo "What do you want to do to this number?"
echo "Enter d, to count down to zero"
echo "Enter u, to count up from zero"
read choice
case $choice in
d) while [ "$number" \>= "0" ]
do
echo $number
$number = `expr $number - 1`
done;;
u) while [ "0" \<= "$number" ]
do
echo $number
$number = `expr $number + 1`
done;;
esac
echo "bye"
~