Created
November 13, 2015 06:29
-
-
Save sogaoh/2e9db036d4224eb63ef7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
while read LINE ;do | |
i=0 | |
for inline in $LINE ;do | |
case $inline in | |
*'@'*) echo $inline \ | |
| gawk '{a=substr($0,1,match($0,"@")-1);\ | |
c=gensub(/[a-z]|[0-9]|[A-Z]/,"*","g",a);\ | |
b=substr($0,match($0,"@"));printf"%s%s",c,b}' ;; | |
*) echo -n "$inline ";; | |
esac | |
done | |
echo | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Execute sample:
./mailmask.sh maillog.txt > maskedlog.txt
refs:
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1116584216