Browse Source

Create 10215501437.sh

main
TheadoraTang 2 years ago
committed by GitHub
parent
commit
e840aec0cd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      lab1/10215501437.sh

+ 15
- 0
lab1/10215501437.sh View File

@ -0,0 +1,15 @@
#!/bash/bin
#生成随机字符串
for i in `seq 1000`;do echo $RANDOM | md5sum | cut -c 1-9 ;done > test.txt
#按照字母顺序排列,输出unique行
sort -u test.txt | uniq
#按照数字顺序排列,输出unique行
sort -u -n test.txt | uniq
#以覆盖写的方式重定向到一个文件
sort -u test.txt | uniq > ans1
sort -u -n test.txt | uniq > ans1
#以追加写的方式重定向到一个文件
sort -u test.txt | uniq >> ans1
sort -u -n test.txt | uniq >> ans1
#寻找to
grep -wo "to" test2.txt | wc-l

Loading…
Cancel
Save