24 lines
341 B
Bash
Executable File
24 lines
341 B
Bash
Executable File
## créer une table de multiplication
|
|
#!/bin/bash
|
|
if [[ $# -lt 2 ]]
|
|
then
|
|
echo "Usage: $0 <numeric_argument> <numeric_argument>"
|
|
exit
|
|
fi
|
|
arg1=$1
|
|
arg2=$2
|
|
if [[ $1 -gt $2 ]]
|
|
then
|
|
arg1=$2
|
|
arg2=$1
|
|
fi
|
|
for((x=$arg1 ; x<=$arg2 ; x++))
|
|
do
|
|
for((y=$arg1 ; y<=$arg2 ; y++))
|
|
do
|
|
printf "%5d " "$((x*y))"
|
|
done
|
|
echo
|
|
done
|
|
exit
|