APL/SCR1.2/TP07/mult_math.sh

34 lines
410 B
Bash
Raw Normal View History

2021-11-16 15:32:33 +01:00
#!/bin/bash
if [[ $# -lt 2 ]]
then
echo"usage:mult_math.sh <int1> <int2>"
exit
fi
if [[ $1 -lt 0 ]]
then
echo "Argument 1 must be postive !!"
exit
fi
if [[ $2 -lt 0 ]]
then
echo "Argument 2 must be postive !!"
exit
fi
if [[ $2 -lt $1 ]]
then
echo "Argument 2 must be more than Argument 1"
exit
fi
for ((i=$1;i<=$2;i++))
do
for ((j=$1;j<=$2;j++))
do
echo -ne "$((i*j))\t"
done
echo -e "\a"
done
exit