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.

40 lines
1.2 KiB

  1. #!/bin/bash
  2. #生成50000行包含字母与数字的文件
  3. #需要从urandom中读取字母与数字,共50000次循环,大概需要5-10min左右。
  4. for((i = 0; i < 50000; i++))
  5. do
  6. head -c 50 /dev/urandom | tr -dc A-Za-z0-9 >> RandFile;
  7. echo -e \ >> RandFile;
  8. done
  9. #按字母排序
  10. sort RandFile | uniq;
  11. #按数字排序
  12. sort -n RandFile | uniq;
  13. #重定向到SortedFile1
  14. sort RandFile | uniq >> SortedFile1;
  15. #重定向到SortedFile2
  16. sort -n RandFile >> SortedFile2;
  17. #统计RandFile中 ab 出现的次数
  18. grep -o ab RandFile|wc -l;
  19. #git push到码园
  20. git init #初始化
  21. git add . #添加文件夹下所有文件
  22. git commit -m "lab1 first commit" #把添加的文件提交到远程版本库
  23. git remote add origin https://gitea.shuishan.net.cn/10215501417/csapp.git #建立远程连接
  24. git push -u origin master #上传代码
  25. #fork工作流:
  26. #首先 fork目标仓库到自己的远程仓库
  27. #再git clone到自己的仓库
  28. git clone https://gitea.shuishan.net.cn/10215501417/Computer-Systems-Labs.git
  29. #创建一个分支
  30. git checkout -b hw
  31. #将代码文件上传
  32. git add 10215501417.sh
  33. git commit -m "10215501417's cmommit"
  34. #然后再发起一个pr到目标仓库