From c173c2f1605579750d1c4853e7fe50f40aa39edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=8C=9C=E9=9B=85?= Date: Sun, 11 Sep 2022 20:26:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'lab1/10215501435.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab1/10215501435.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lab1/10215501435.sh diff --git a/lab1/10215501435.sh b/lab1/10215501435.sh new file mode 100644 index 0000000..07be095 --- /dev/null +++ b/lab1/10215501435.sh @@ -0,0 +1,23 @@ +#!/bin/bash +#生成50行随机字符串 +for i in {1..50} +do + echo $RANDOM | md5sum | cut -c 1-9 >> random_50.txt +done +#将上述50行随机的字符串循环100次,得到5000行有规律的字符串 +times=1 +while((times<=100)) +do + head -n 50 random_50.txt >> random_5000.txt + times=`expr $times + 1` +done +#以覆盖写的方式,字母排序,输出unique行 +sort -u random_5000.txt > alph.txt +#以覆盖写的方式,数字排序,输出unique行 +sort -u -n random_5000.txt > number.txt +#以追加写的方式,字母排序,输出unique行 +sort -u random_5000.txt >> alph.txt +#以追加写的方式,数字排序,输出unique行 +sort -u -n random_5000.txt >> number.txt +#已经生成一个含有60个Computer的letter文件 +grep -c "Computer" letter.txt \ No newline at end of file From 4d0315b0f711bcf62fee6d6472ce7ae1692acae4 Mon Sep 17 00:00:00 2001 From: 10215501435 Date: Mon, 12 Sep 2022 11:22:28 +0800 Subject: [PATCH 2/3] add test.sh --- lab1/test.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 lab1/test.sh diff --git a/lab1/test.sh b/lab1/test.sh new file mode 100644 index 0000000..b1d57c2 --- /dev/null +++ b/lab1/test.sh @@ -0,0 +1 @@ +sort test.sh | uniq From f8541e6056a95661b16b6b650f617e65a9c0eca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=8C=9C=E9=9B=85?= Date: Mon, 12 Sep 2022 18:39:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'lab1/test.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab1/test.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100644 lab1/test.sh diff --git a/lab1/test.sh b/lab1/test.sh deleted file mode 100644 index b1d57c2..0000000 --- a/lab1/test.sh +++ /dev/null @@ -1 +0,0 @@ -sort test.sh | uniq