- shell脚本打印等腰三角形
#!/bin/bash for ((i=1;i<=9;i++)) do for ((j=9;j>=i;j--)) do echo -n " " done for ((j=2;j<=i;j++)) do echo -n "*" done for ((j=1;j<=i;j++)) do echo -n "*" done echo done
#!/bin/bash for ((i=1;i<=9;i++)) do for ((j=9;j>=i;j--)) do echo -n " " done for ((j=2;j<=i;j++)) do echo -n "*" done for ((j=1;j<=i;j++)) do echo -n "*" done echo done