#!/bin/bash
a=1
b=10
while [ $a -le $b ]
do
c=1
while [ $c -le $a ]
do
echo -n \*
let c++
done
let a++
echo
done
分享到:
------解决方案--------------------
#!/bin/bash
a=1
b=5
count=1
s=1
while [ $a -le $b ]
do
c=1
while [ $c -le $count ]
do
echo -n $a
let a++
let c++
done
echo
let count++
let s++
a=$s
done