Revision | 53cc9464815b2eaf119964c303f79c60f2a66bc5 (tree) |
---|---|
Zeit | 2014-09-01 02:33:03 |
Autor | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
I renamed the file (before it was hidden).
@@ -1,22 +0,0 @@ | ||
1 | -#!/bin/sh | |
2 | - | |
3 | -MESSAGE=$(cat) | |
4 | - | |
5 | -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;}}') | |
6 | - | |
7 | -# if grep -Fxq "$NEWALIAS" $HOME/.mutt/aliases.txt; then | |
8 | -# : | |
9 | -# else | |
10 | -# echo "$NEWALIAS" >> $HOME/.mutt/aliases.txt | |
11 | -# fi | |
12 | - | |
13 | -# echo "${MESSAGE}" | |
14 | - | |
15 | - | |
16 | -if grep -Fxq "$NEWALIAS" ~/.mutt-alias.txt; then | |
17 | - : | |
18 | -else | |
19 | - echo "$NEWALIAS" >> ~/.mutt-alias.txt | |
20 | -fi | |
21 | - | |
22 | -echo "${MESSAGE}" |
@@ -0,0 +1,22 @@ | ||
1 | +#!/bin/sh | |
2 | + | |
3 | +MESSAGE=$(cat) | |
4 | + | |
5 | +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;}}') | |
6 | + | |
7 | +# if grep -Fxq "$NEWALIAS" $HOME/.mutt/aliases.txt; then | |
8 | +# : | |
9 | +# else | |
10 | +# echo "$NEWALIAS" >> $HOME/.mutt/aliases.txt | |
11 | +# fi | |
12 | + | |
13 | +# echo "${MESSAGE}" | |
14 | + | |
15 | + | |
16 | +if grep -Fxq "$NEWALIAS" ~/.mutt-alias.txt; then | |
17 | + : | |
18 | +else | |
19 | + echo "$NEWALIAS" >> ~/.mutt-alias.txt | |
20 | +fi | |
21 | + | |
22 | +echo "${MESSAGE}" |