修訂. | 53cc9464815b2eaf119964c303f79c60f2a66bc5 |
---|---|
大小 | 529 bytes |
時間 | 2014-09-01 02:33:03 |
作者 | Lorenzo Isella |
Log Message | I renamed the file (before it was hidden). |
#!/bin/sh
MESSAGE=$(cat)
NEWALIAS=$(echo "${MESSAGE}" | grep ^"From: " | sed s/[\,\"\']//g | awk '{$1=""; if (NF == 3) {print "alias" $0;} else if (NF == 2) {print "alias" $0 $0;} else if (NF > 3) {print "alias", tolower($(NF-1))"-"tolower($2) $0;}}')
# if grep -Fxq "$NEWALIAS" $HOME/.mutt/aliases.txt; then
# :
# else
# echo "$NEWALIAS" >> $HOME/.mutt/aliases.txt
# fi
# echo "${MESSAGE}"
if grep -Fxq "$NEWALIAS" ~/.mutt-alias.txt; then
:
else
echo "$NEWALIAS" >> ~/.mutt-alias.txt
fi
echo "${MESSAGE}"