Révision | 53cc9464815b2eaf119964c303f79c60f2a66bc5 |
---|---|
Taille | 529 octets |
l'heure | 2014-09-01 02:33:03 |
Auteur | Lorenzo Isella |
Message de Log | 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}"