代码
#!/bin/bash
for ((i=1;i<=9;i++))
do
a=$[($i*2)-1]
for ((j=10;j>=$i;j--))
do
echo -n " "
done
for ((k=1;k<=$a;k++))
do
echo -n "*"
done
echo ""
done
for ((i=1;i<=10;i++))
do
a=$[($i*2)-1]
for ((j=1;j<=$i;j++))
do
echo -n " "
done
for ((k=10;k>=$i;k--))
do
echo -n "*"
done
for ((l=9;l>=$i;l--))
do
echo -n "*"
done
echo ""
done