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

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