python脚本
import random with open(r'D:pyta.txt','r',encoding='utf-8') as f1,open(r'D:pyta.txt','w',encoding='utf-8') as f2: for i in range(101): f2.write('%d ' % random.randint(1,100))
shell脚本
#!/bin/bash for i in `seq 100` do m=$(echo $RANDOM | md5sum | cut -c 1-6) echo "$m" >> testa done ~ ~