#!/bin/bash
sum()
{
total=0
for num in `seq $1 $2`
do
let total+=num
done
echo $total
}
read -p "Input number1: " num1
read -p "Input number2: " num2
if [ $num1 -ge $num2 ]; then
echo "Wrong number!"
exit 1
fi
sum $num1 $num2
exit 0
#!/bin/bash
sum()
{
total=0
for num in `seq $1 $2`
do
let total+=num
done
echo $total
}
read -p "Input number1: " num1
read -p "Input number2: " num2
if [ $num1 -ge $num2 ]; then
echo "Wrong number!"
exit 1
fi
sum $num1 $num2
exit 0