标签:file md5sum echo dev .sh md5 cal done i++
随机生成50个密码到指定文件中[root@local-centos7 ~]# cat round.sh
#!/bin/bash
count=1
while [ $count -le 50 ]
do
round=`cat /dev/urandom | head -n 10 | md5sum | head -c 8`
echo $round >> /root/round.txt
let count++
done
或者也可以这样来写
for((i=1;i<=50;i++)); do head -n 10 /dev/urandom| md5sum | head -c 8|sed -nr ‘s#.*#&\n#pg‘|tee -a file &>/dev/null ; done
标签:file md5sum echo dev .sh md5 cal done i++
原文地址:http://blog.51cto.com/innocence/2152876