标签:exp for return dom csv ++ echo done nop
生成随机字符串#!/usr/bin/php
<?php
function str_rand($length = 11, $char = ‘0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ‘) {
if(!is_int($length) || $length < 0) {
return false;
}
$string = ‘‘;
for($i = $length; $i > 0; $i--) {
$string .= $char[mt_rand(0, strlen($char) - 1)];
}
return $string;
}
for($i=0;$i<10;$i++){
$str = str_rand();
file_put_contents("test123.txt","$str\n",FILE_APPEND);
}
#!/bin/bash
randstr() {
index=0
str=""
for i in {A..Z}
do
arr[index]=$i
index=`expr ${index} + 1`
done
for i in {0..9}
do
arr[index]=$i
index=`expr ${index} + 1`
done
for i in {1..11}
do
str="$str${arr[$RANDOM%$index]}"
done
echo $str
}
for i in {0..5000}
do
echo `randstr` >>test.csv
done
标签:exp for return dom csv ++ echo done nop
原文地址:http://blog.51cto.com/8588192/2336119