Multiplication table of shell scripts

1 #!/bin/bash
  2 for i in {1..9};do
  3         for((j=1;j<=i;j++))do
  4                 echo -ne "$i×$j=$(($i*$j))\t"          #每一次内循环不换行显示,且每一个算式之间插入tab
  5         done
  6         echo -e "\n"                                          #每一次内循环完了之后,换行输出
  7 done

Execution results are as follows:
Multiplication table of shell scripts

Guess you like

Origin blog.51cto.com/11342825/2430541