(1) The shell prints the pattern as shown.
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/07/9D/wKiom1nMh-ygSI1MAAAj5j4UcHs376.png-wh_500x0-wm_ 3-wmp_4-s_3715701053.png "title=" capture. PNG "alt=" Wkiom1nmh-ygsi1maaaj5j4uchs376.png-wh_50 "/>
The shell code is as follows:
#!/bin/bash
echo "-"
For i in ' seq 9 '
Do
For x in ' seq $i '
Do
Echo-n ""
Done
echo "|"
Echo
For y in ' seq $i '
Do
Echo-n ""
Done
echo "-"
Done
echo "|"
Echo
Two
A ball from 100 meters height of the free fall, each landing after jumping back to the original height of half, and then fall, begging for it in the 10th time on the landing, total after how many meters? How high is the 10th rebound?
The shell code is as follows
#!/bin/bash
x=100
For i in ' seq 10 '
Do
x= ' awk ' begin{printf ' $x '/2} '
Done
Echo $x
Output Result:
[Email protected] ding]# bash 22.sh
0.097656
[Email protected] ding]#
This article is from the "It Life" blog, so be sure to keep this source http://dingxue.blog.51cto.com/12290895/1969406
Shell finishing (32) = = = Two small examples of nested loops