#!/bin/bash
for((i=1;i<=9;i++))
do
for((j=1;j<=${i};j++))
do
set x, y, temp,z
if [ ${#i} -eq 1 ]; then
x=0${i}
else
x=${i}
fi
if [ ${#j} -eq 1 ]; then
y=0${j}
else
y=${j}
fi
temp=$((ij))
if [ ${#temp} -eq 1 ]; then
z=0${temp}
else
z=${temp}
fi
if [ $j -eq $i ]; then
echo -e "\033[32m ${x}${y}=${z}\033[0m"
else
echo -n -e "\033[32m ${x}*${y}=${z} \033[0m"
fi
done
done
转载于:https://blog.51cto.com/13765598/2120048