问轩博客

展开菜单

continue,break,exit小例子

continue,break,exit小例子
[root@shnne ~]# vim test.sh #!/bin/sh for ((i=0; i<=5; i++)) do    if [ $i -eq 3 ]     then        #contin...

shell批量修改文件名方法

shell批量修改文件名方法
1. 创建 [root@shnne ~]# cat mk.sh  #!/bin/sh for((i=1; i<=10; i++)) do   j=`cat /dev/urandom|head -1|md5sum|cut -c 1-5`   touch shnne/${j}_shnne_$i.html don...

for小练习

for小练习
通过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 f...