31 lines
437 B
Bash
31 lines
437 B
Bash
|
#!/bin/bash
|
||
|
if [[ $# -ne 2 ]]
|
||
|
then
|
||
|
echo "Usage: ./mult_mat.sh <NUM_ARG1> <NUM_ARG2>"
|
||
|
exit
|
||
|
fi
|
||
|
if [[ $1 -gt $2 ]]
|
||
|
then
|
||
|
echo "First argument must be less than second argument !!"
|
||
|
exit
|
||
|
fi
|
||
|
if [[ $1 -lt 0 ]]
|
||
|
then
|
||
|
echo "Arguments must be positive !!"
|
||
|
exit
|
||
|
fi
|
||
|
if [[ $2 -lt 0 ]]
|
||
|
then
|
||
|
echo "Arguments must be positive !!"
|
||
|
exit
|
||
|
fi
|
||
|
for ((i=$1;i<=$2;i++))
|
||
|
do
|
||
|
for ((f=$1;f<=$2;f++))
|
||
|
do
|
||
|
echo -ne "$((i*f))\t"
|
||
|
done
|
||
|
echo -e "\n"
|
||
|
done
|
||
|
exit
|