diff options
author | Ben Sima <ben@bsima.me> | 2018-07-05 13:30:36 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-07-05 13:30:36 -0700 |
commit | f41646f7ec4bf28e2bcbe19bb9b92637055cbc9d (patch) | |
tree | 8d40261a9e721440f25ccc7c17fdec6e2c7308a1 /mutt/generate-contacts.sh | |
parent | 358c68f482bf3f832f619571355a8b68b29beebd (diff) |
Add some mutt stuff
- added lynx
- render html emails in lynx
- c.f. http://blog.deadlypenguin.com/blog/2009/04/21/mutt-and-lynx/
- added a readme
- maybe other stuff, i forget
Diffstat (limited to 'mutt/generate-contacts.sh')
-rwxr-xr-x | mutt/generate-contacts.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mutt/generate-contacts.sh b/mutt/generate-contacts.sh new file mode 100755 index 0000000..ab3cacb --- /dev/null +++ b/mutt/generate-contacts.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh +# +# Source: http://wcm1.web.rice.edu/mutt-tips.html + +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/contacts.txt; then + : +else + echo "$NEWALIAS" >> $HOME/contacts.txt +fi + +echo "${MESSAGE}" |