From e8e50305049115362aa507219a3c5bd4a3ea8f01 Mon Sep 17 00:00:00 2001 From: YifeiLong Date: Sun, 11 Sep 2022 18:02:47 +0800 Subject: [PATCH] 10215501415 --- lab1/10215501415.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lab1/10215501415.sh diff --git a/lab1/10215501415.sh b/lab1/10215501415.sh new file mode 100644 index 0000000..83893ef --- /dev/null +++ b/lab1/10215501415.sh @@ -0,0 +1,15 @@ +#两个字符串文件均由python生成 +#按数字排序 + +#覆盖写 +cat hw1.txt | sort | uniq -d > 1.txt +cat hw1.txt | sort -n | uniq -d > 1.txt + +#追加写 +cat hw1.txt | sort | uniq -d >> 2.txt +cat hw1.txt | sort -n | uniq -d >> 2.txt + + +#找出指定字符串 +grep computer hw1-2.txt +grep -c computer hw1-2.txt \ No newline at end of file