Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、私はこれを試しました。以下のスクリプトを拡張して、現在の日付を件名としてメールを送信し、out.txt に既に含まれている日付を現在の日付 (TodayDate) 07/30/2012(/TodayDate) に置き換えたいと考えています。タグはこのようになり、現在の日付に置き換えたい
grep -i "<returnMessage>" out.txt |mailx -s " we are fine on $date" xyz@yahoo.com
sed を使用して実行できます。次の内容を持つ temp.sh などの sh ファイルを作成します。
CURR_DT=`date +"%m/%d/%Y"` echo `sed "s;..\/..\/....;$CURR_DT;g" out.txt`
次に、次のコマンドを実行します -
sh temp.sh | mail -s `date +"%m/%d/%Y"` xyz@yahoo.com
ただし、(TodayDate) タグは使用しません。