#!/bin/bash
# *********************************************************#
# #
# * Author : 藻头男 #
# * QQ邮箱 : 2322944912@qq.com #
# * Create time : 2024-01-02-21-00-00 #
# * Filename : cheng.sh #
# * Description : This is Shell scripts #
# #
# #
# ********************************************************#
clear #清屏执行
#第一种方法for循环
for i in {1..9}
do
for o in `seq $i`
do
echo -n -e "$o x $i = $[$i*$o]\t"
done
echo
done
echo ""
#第二种方法while循环
a=0
while [ $a -lt 9 ]
do
let a++
b=0
while [ $b -lt $a ]
do
let b++
echo -ne "$b x $a = $[$b*$a]\t"
done
echo
done
感谢观看!希望能够帮助到大家!