#!/bin/bash [!-d/oldboy]&&mkdir/oldboy cd/oldboy for((i=0;i<10;i++)) do aa="`echo$RANDOM|md5sum|cut-c1-11`" touch"$aa"_oldboy.html done ~
2.批量改名
将上面的oldboy全部改成oldgirl(最好用for实现),并将扩展名修改成大写
#!/bin/bash cd/oldboy foriin`ls/oldboy` do rename"oldboy""oldgirl"/oldboy/$i rename"HTML""html"/oldboy/$i done ~
3.扫描网络内存活的主机:
#!/bin/bash foriin`seq10` do ip=192.168.116.$i ping-W5-c2$ip>/dev/null aa=$? if[$?-ne0] then echo"this$ipisbad..." else echo"this$ipisgood..." fi done ~原文链接:/bash/388689.html