Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Aug 5, 2017
1 parent 38b16eb commit 077ff07
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shell/awk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
##robert yu
##centos 6和centos 7

##按第六列 重复的删除,并保留一行
awk '!arr[$6]++' file

##按第2列和第三 重复的删除,并保留一行
awk '!arr[$2$3]++' test.log
awk '!arr[$2_$3]++' test.log

##提取两个文件第一列相同的行
awk -F',' 'NR==FNR{a[$1]=$0;next}NR>FNR{if($1 in a)print $0"\n"a[$1]}' 1.log 2.log

Expand Down
30 changes: 30 additions & 0 deletions shell/mail1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
## IMAP方式批量删除邮箱邮件 2017-08-05
## http://www.aqzt.com
## email: [email protected]
## robert yu
## centos 7
## crontab定时 0 */20 * * * bash /opt/sh/mail1.sh 500 | telnet imap.189.cn 143
### [email protected] 替换为你的邮箱
### password123 替换为你的邮箱密码
### bash /opt/sh/mail1.sh 500 | telnet imap.189.cn 143

MAX_MESS=$1
[ $# -eq 0 ] && exit 1 || :
sleep 2
echo "A01 login [email protected] password123"
sleep 1
echo "A02 LIST '' *"

sleep 2
echo "A03 Select INBOX"
sleep 2
for (( j = 2 ; j <= $MAX_MESS; j++ ))
do
echo "A09 Store $j +FLAGS (\Deleted)"

echo "A10 Expunge"
sleep 1
done
echo QUIT
date >> /tmp/mail1.log

0 comments on commit 077ff07

Please sign in to comment.