循环嵌套脚本

echo -n aaa                          -n的用法,不换行输出

echo “*”          输出*

 

 

输出line行的char三角形

#!/bin/bash
echo "please input number"
read line
echo "please input char number"
read char
a=1
while [ $a -le $line ]
do
        b=1
        while [ $b -le $a ]
        do
                echo -n "$char"
                b=`expr $b + 1`
        done
        echo
        a=`expr $a + 1`
done

 

 

cat <<EOF的用法

#!/bin/bash

cat <<EOF

  *

 **

****

eee

 

posted on 2017-11-07 22:24  厘米之间  阅读(120)  评论(0编辑  收藏  举报

导航