• R/O
  • SSH

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

File Info

修訂. 53cc9464815b2eaf119964c303f79c60f2a66bc5
大小 529 bytes
時間 2014-09-01 02:33:03
作者 Lorenzo Isella
Log Message

I renamed the file (before it was hidden).

Content

#!/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}"