shell实例--九九乘法表

for i in {1..9};do for j in $( seq 1 $i );do echo -n "$j * $i = $(($j*$i))";echo -n $'\t';done;echo;done

脚本方式:

#!/bin/bash

for i in {1..9}

do

  for j in $( seq 1 $i )

  do

    echo -n "$j * $i = $(($j*$i))"

    echo -n $'\t'

  done

  echo

done

posted @ 2022-02-01 14:19  盗哥泡茶去了  阅读(100)  评论(0编辑  收藏  举报