-
Notifications
You must be signed in to change notification settings - Fork 0
/
minicom.sh
executable file
·49 lines (37 loc) · 1.54 KB
/
minicom.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/bash
filename='cap'
echo "starting work ..."
if [ -r $filename ]
then
rm -f $filename
fi
sudo minicom -C $filename
grep 'NY' $filename |sed 's/^.*NY//' | \
sed 's/ap.*//' | sed 's/\(.*\)\(.\{6\}\)/\1/g' | \
sed '/^[A-Z]/d' |sed 's/ //' |sed 's/\(.*\)\(.\{7\}\)/\1/' | \
sort -n | sed '$!N;s/\n/\t/' | \
sed '$!N;s/\n/\t/'| sed '1s/^/南院: \n/'
grep "PXL" $filename | awk '{print $2}' | \
awk -F '-' '{print $2}' | sort -n | sed '$!N;s/\n/\t/' | \
sed '$!N;s/\n/\t/' | sed "1i培训楼:"
grep 'BJ' $filename |sed 's/^.*BJ//' | \
sed 's/ap.*//' | sed 's/\(.*\)\(.\{6\}\)/\1/g' | \
sed '/^[A-Z]/d' |sed 's/ //' |sed 's/\(.*\)\(.\{7\}\)/\1/' | \
sort -n | sed '$!N;s/\n/\t/' | \
sed '$!N;s/\n/\t/'| sed '1s/^/滨江: \n/'
grep 'QM' $filename |sed 's/^.*QM//' | \
sed 's/ap.*//' | sed 's/\(.*\)\(.\{6\}\)/\1/g' | \
sed '/^[A-Z]/d' |sed 's/ //' |sed 's/\(.*\)\(.\{7\}\)/\1/' | \
sort -n | sed '$!N;s/\n/\t/' | \
sed '$!N;s/\n/\t/'| sed '1s/^/亲民: \n/'
grep 'MD' $filename |sed 's/^.*MD//' | \
sed 's/ap.*//' | sed 's/\(.*\)\(.\{6\}\)/\1/g' | \
sed '/^[A-Z]/d' |sed 's/ //' |sed 's/\(.*\)\(.\{7\}\)/\1/' | \
sort -n | sed '/^ *$/d'| sed '$!N;s/\n/\t/' | \
sed '$!N;s/\n/\t/'| sed '1s/^/明德: \n/'
grep 'XH' $filename |sed 's/^.*XH//' | \
sed 's/ap.*//' | sed 's/\(.*\)\(.\{6\}\)/\1/g' | \
sed '/^[A-Z]/d' |sed 's/ //' |sed 's/\(.*\)\(.\{7\}\)/\1/' | \
sort -n | sed '$!N;s/\n/\t/' | \
sed '$!N;s/\n/\t/'| sed '1s/^/学海: \n/'
rm -f $filename