0
#! /bin/bash 

echo -e "Please enter a number: \c"
read -r x
echo -e "Please enter the last number you wished to have multiplied: \c"
read -r last_num

j=1

while [[ $j -le $last_num ]]
do
    ans=`expr $x \* $j`
    echo "$x * $j = $ans"
    ((j++))
done
echo -e "Do you wish to carry out another multiplication? [y/n] \c"
read -r response

    if [ $response == y -o $response == Y ]; then
    continue
# ***
# the continue statement does not run when I enter Y or y, but the else
# statement do run
# ***
    else
    echo "Goodbye"
    exit
    fi

4

0 回答 0