Skip to content

Commit 077ff07

Browse files
committed
update
1 parent 38b16eb commit 077ff07

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

shell/awk.sh

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
##robert yu
66
##centos 6和centos 7
77

8+
##按第六列 重复的删除,并保留一行
9+
awk '!arr[$6]++' file
10+
11+
##按第2列和第三 重复的删除,并保留一行
12+
awk '!arr[$2$3]++' test.log
13+
awk '!arr[$2_$3]++' test.log
14+
815
##提取两个文件第一列相同的行
916
awk -F',' 'NR==FNR{a[$1]=$0;next}NR>FNR{if($1 in a)print $0"\n"a[$1]}' 1.log 2.log
1017

shell/mail1.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
## IMAP方式批量删除邮箱邮件 2017-08-05
3+
## http://www.aqzt.com
4+
5+
## robert yu
6+
## centos 7
7+
## crontab定时 0 */20 * * * bash /opt/sh/mail1.sh 500 | telnet imap.189.cn 143
8+
### [email protected] 替换为你的邮箱
9+
### password123 替换为你的邮箱密码
10+
### bash /opt/sh/mail1.sh 500 | telnet imap.189.cn 143
11+
12+
MAX_MESS=$1
13+
[ $# -eq 0 ] && exit 1 || :
14+
sleep 2
15+
echo "A01 login [email protected] password123"
16+
sleep 1
17+
echo "A02 LIST '' *"
18+
19+
sleep 2
20+
echo "A03 Select INBOX"
21+
sleep 2
22+
for (( j = 2 ; j <= $MAX_MESS; j++ ))
23+
do
24+
echo "A09 Store $j +FLAGS (\Deleted)"
25+
26+
echo "A10 Expunge"
27+
sleep 1
28+
done
29+
echo QUIT
30+
date >> /tmp/mail1.log

0 commit comments

Comments
 (0)