python脚本
import random with open(r'D:\pyt\a.txt','r',encoding='utf-8') as f1,open(r'D:\pyt\a.txt','w',encoding='utf-8') as f2: for i in range(101): f2.write('%d\n' % 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 ~ ~