awk方式:
# awk 'BEGIN{for(i=1;i<=9;i++){for(j=1;j<=i;j++){printf j"x"i"="i*j " "} print ""}}'
for循环方式:
#!/bin/bash for i in `seq 9` do for j in `seq 9` do [ $j -le $i ] && echo -ne "$j*$i=$((i*j)) " done echo -e " " done