通过for循环打印5 4 3 2 1
[root@shnne ~]# cat for1.sh #!/bin/sh for i in 5 4 3 2 1 do echo $i done [root@shnne ~]# cat for2.sh #!/bin/sh for i in {5..1} do echo $i done [root@shnne ~]# cat for3.sh #!/bin/sh for i in `seq 5 -1 1` do echo $i done [root@shnne ~]# cat for4.sh #!/bin/sh for((i=5; i>=1; i--)) do echo $i done