소스 검색

add 10215501450

master
刘钊瑄 1 년 전
부모
커밋
bf6d9cced1
1개의 변경된 파일28개의 추가작업 그리고 0개의 파일을 삭제
  1. +28
    -0
      lab1/10215501450.sh

+ 28
- 0
lab1/10215501450.sh 파일 보기

@ -0,0 +1,28 @@
作业1:
#生成50000行文件
for i in $(seq 1 50000)
do
echo $RANDOM|md5sum|cut -c 1-9
done >> test.txt
#按照字母顺序排序,输出unique行
sort -u test.txt
#按照数字顺序排序,输出unique行
sort -u -n test.txt
#以覆盖写的方式重定向到一个文件(1.txt)
sort -u test.txt > 1.txt
sort -u -n test.txt > 1.txt
#以追加写的方式重定向到一个文件(2.txt)
sort -u test.txt >> 2.txt
sort -u -n test.txt >> 2.txt
作业2:
#已随机生成文件
#找"computer"
grep "computer" computer.txt
#统计其中包含多少"computer"
grep -o "computer" computer.txt|wc -w

불러오는 중...
취소
저장