展开全部
[root@localhost /]# cat test.sh
#!/bin/sh
i=1
while [ $i -lt 100 ]
do
b=1
while [ $b -le $i ]
do
echo "$i" | tr -d "\n"
b=`expr $b + 1`
done
echo ""
i=`expr $i + 1`
done
[root@localhost /]# ./test.sh
1
22
333
4444
55555
666666
7777777
88888888
999999999
10101010101010101010
1111111111111111111111
121212121212121212121212
13131313131313131313131313
1414141414141414141414141414
151515151515151515151515151515
16161616161616161616161616161616
1717171717171717171717171717171717
181818181818181818181818181818181818
19191919191919191919191919191919191919
2020202020202020202020202020202020202020
212121212121212121212121212121212121212121
22222222222222222222222222222222222222222222
2323232323232323232323232323232323232323232323
242424242424242424242424242424242424242424242424
兄弟,多动点脑子呀。还有,可以就别忘记采纳了。
#!/bin/sh
i=1
while [ $i -lt 100 ]
do
b=1
while [ $b -le $i ]
do
echo "$i" | tr -d "\n"
b=`expr $b + 1`
done
echo ""
i=`expr $i + 1`
done
[root@localhost /]# ./test.sh
1
22
333
4444
55555
666666
7777777
88888888
999999999
10101010101010101010
1111111111111111111111
121212121212121212121212
13131313131313131313131313
1414141414141414141414141414
151515151515151515151515151515
16161616161616161616161616161616
1717171717171717171717171717171717
181818181818181818181818181818181818
19191919191919191919191919191919191919
2020202020202020202020202020202020202020
212121212121212121212121212121212121212121
22222222222222222222222222222222222222222222
2323232323232323232323232323232323232323232323
242424242424242424242424242424242424242424242424
兄弟,多动点脑子呀。还有,可以就别忘记采纳了。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询