Trouble with a basic bash script
Hi
I'm new to bash scripting in linux. I'm trying to make a script that reads numbers users write and then adds them.
This is what I've written so far..
#!/bin/bash
# A script that adds numbers
NUMBER=0
sum=0
declare -i number
echo "Enter a number"
read NUMBER
for add in *
do
if [ $NUMBER = $number ]
then
$NUMBER+=$sum
echo "Plz enter a new number, quit with a character"
read NUMBER
return
fi
#done
echo "You did not enter a number! The sum added up is $sum"
exit 0
|