SCRDEV/SCR.1.2/TP08/mult_mat.sh

28 lines
328 B
Bash
Raw Normal View History

2024-12-04 12:01:04 +01:00
#!/bin/bash
if [[ $# -lt 2 ]]
then
echo "Usage: $0 <mumarg1> <numarg2>"
exit
fi
if [[ $1 -gt $2 ]]
then
echo "Tu dois donne un 1er paramètre moins gros que celui de le deuxieme paramètre"
exit
fi
ARG=$1
ARG2=$2
for ((i=ARG; i<=ARG2;i++))
do
for((j=ARG; j<=ARG2;j++))
do
echo -n $((i*j))" "
done
echo ""
done
exit