Pārlūkot izejas kodu

Merge pull request #5 from oncetrange/main

10215501414 homework
main
Eugene Zhu pirms 2 gadiem
revīziju iesūtīja GitHub
vecāks
revīzija
9fccc810ff
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar 16 papildinājumiem un 0 dzēšanām
  1. +16
    -0
      lab1/10215501414.sh

+ 16
- 0
lab1/10215501414.sh Parādīt failu

@ -0,0 +1,16 @@
#生成文件
for i in `seq 5000`;
do echo $RANDOM | md5sum | cut -c 1-9;
done>>test.txt;
#1
sort -u test.txt #按字母排序
sort -u -n test.txt #按数字排序
sort -u test.txt>1.txt #将字母排序结果覆盖写到1.txt中
sort -u test.txt>>2.txt #将字母排序结果追加写到2.txt中
sort -u -n test.txt>1.txt #将数字排序结果覆盖写到1.txt中
sort -u -n test.txt>>2.txt #将数字排序结果追加写到2.txt中
#2
grep "abc" test.txt #找出内容包含"abc"的字符串并输出
grep -c "abc" test.txt #统计内容包含"abc"的行数并输出

Notiek ielāde…
Atcelt
Saglabāt