#!/bin/bash # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Copyright (c) 2010 FSOCA final project | http://joaosantacruz.com # This script is licensed under GNU GPL version 2.0 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # From a sed script file (sed-usage.sed) read through a file /tmp/teste/email.txt that will # be provided and change all instances of SENDER to your firstname. Also change all # instances of RECIPIENT to John. # Extension: Change all instances of RECIPIENTemail to john.thomson@caixamagica.pt and # SENDERemail to your email address. Also change all instances of DATE to the current date. # Output to a file in the same location called Òemail-to-send.txtÓ. Every second line start the # line with ÒEven:Ó Every 3rd line start with ÒMultipleOf3:Ó. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - clear echo "= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" echo " SED Usage " echo "= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" echo "" date=`date +"%Y-%m-%d"` auxFile="tempFile" sed -f sed-usage.sed <"email.txt" >"email-to-send.txt" cat email-to-send.txt echo -e "\n\nPress any key to continue...('DATE' replacement)\n\n" read dummy cat "email-to-send.txt" > $auxFile sed 's/DATE/'"$date"'/g' <"$auxFile" >"email-to-send.txt" rm $auxFile cat email-to-send.txt echo "" echo "= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" echo "Press [enter] key to continue. . ."; read pressedKey