#!/bin/bash # author: movekj.com # date: 2015.7.6 # description: print 9*9 table # version: 0.0.1 declare -i I=0 declare -i J=0 declare -i N=0 for I in {0..8} do A[$I]=$[$I+1] done while [ $J -le 8 ] do for N in {0..8} do if [ $N -lt $J ] then echo -en "${A[$J]}X${A[$N]}=\033[31m$[${A[$J]}*${A[$N]}]\033[0m\t" else echo -e "${A[$J]}X${A[$N]}=\033[31m$[${A[$J]}*${A[$N]}]\033[0m" break fi done let J++ done
本文出自 “木屋科技” 博客,请务必保留此出处http://starli.blog.51cto.com/8813574/1671327
原文地址:http://starli.blog.51cto.com/8813574/1671327