diff options
author | Ben Sima <ben@bsima.me> | 2019-08-27 14:34:49 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-08-27 14:34:49 -0700 |
commit | f3b91d75d2d3153e9fa4d7414929dcc531779727 (patch) | |
tree | c49dc426b64cec2d47dc594a1a5398244ccc4dd0 /mutt/generate-contacts.sh | |
parent | 8c810428d6d93ba718df7e8388615ad7fa3d092c (diff) |
reorganize, and some small fixes
Diffstat (limited to 'mutt/generate-contacts.sh')
-rwxr-xr-x | mutt/generate-contacts.sh | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/mutt/generate-contacts.sh b/mutt/generate-contacts.sh deleted file mode 100755 index ab3cacb..0000000 --- a/mutt/generate-contacts.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/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}" |