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.

20 regels
485 B

2 jaren geleden
  1. #!/bin/bash
  2. # 读取随机数据并转为 base64 编码
  3. head -n 50000 /dev/urandom | base64 > random;
  4. # 抽取 50000 行数据
  5. head -n 50000 random > random2;
  6. # rename
  7. rm random;
  8. mv random2 random;
  9. # 按 asc 排序
  10. sort --unique random > unique_sort_by_asc;
  11. # 按 num 排序
  12. sort --unique --numeric-sort random > unique_sort_by_num;
  13. # 追加写
  14. cat unique_sort_by_asc > totall;
  15. cat unique_sort_by_num >> totall;
  16. # 匹配并统计字符
  17. grep -o "com" totall | wc -l > number_of_com;