You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
776 B

  1. #!/bin/bash
  2. #生成50行随机字符串
  3. for i in {1..50}
  4. do
  5. echo $RANDOM | md5sum | cut -c 1-9 >> random_50.txt
  6. done
  7. #将上述50行随机的字符串循环100次,得到5000行有规律的字符串
  8. times=1
  9. while((times<=100))
  10. do
  11. head -n 50 random_50.txt >> random_5000.txt
  12. times=`expr $times + 1`
  13. done
  14. #以覆盖写的方式,字母排序,输出unique行
  15. sort -u random_5000.txt > alph.txt
  16. #以覆盖写的方式,数字排序,输出unique行
  17. sort -u -n random_5000.txt > number.txt
  18. #以追加写的方式,字母排序,输出unique行
  19. sort -u random_5000.txt >> alph.txt
  20. #以追加写的方式,数字排序,输出unique行
  21. sort -u -n random_5000.txt >> number.txt
  22. #已经生成一个含有60个Computer的letter文件
  23. grep -c "Computer" letter.txt