代码如下:

 1 #!/bin/sh
 2 #################################################################
 3 # Author:91coder
 4 # Blog:  www.cnblogs.com/91coder
 5 #################################################################
 6 
 7 # 创建目录
 8 Path=/91coder
 9 [ -d "$Path" ]||mkdir -p $Path
10 
11 # 创建文件
12 for n in `seq 10`
13 do
14     random=$(openssl rand -base64 40|sed 's#[^a-z]##g'|cut -c 2-11)
15     touch $Path/${random}_91coder.html
16 done

运行结果:

 1 [root@warrendevops ~]# ll /91coder/
 2 total 0
 3 -rw-r--r--. 1 root root 0 Feb  4 14:51 dgyelwxmgt_91coder.html
 4 -rw-r--r--. 1 root root 0 Feb  4 14:51 igcaczxyun_91coder.html
 5 -rw-r--r--. 1 root root 0 Feb  4 14:51 itrwznpytf_91coder.html
 6 -rw-r--r--. 1 root root 0 Feb  4 14:51 mnjzmclxrs_91coder.html
 7 -rw-r--r--. 1 root root 0 Feb  4 14:51 ndcbqhttit_91coder.html
 8 -rw-r--r--. 1 root root 0 Feb  4 14:51 nexnbwzmak_91coder.html
 9 -rw-r--r--. 1 root root 0 Feb  4 14:51 pobtynbzfe_91coder.html
10 -rw-r--r--. 1 root root 0 Feb  4 14:51 stusewzwyn_91coder.html
11 -rw-r--r--. 1 root root 0 Feb  4 14:51 wbmzcpugna_91coder.html
12 -rw-r--r--. 1 root root 0 Feb  4 14:51 zgmqeywark_91coder.html

 

posted @ 2017-02-04 23:13 91Coder 阅读(673) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示