I am running a command to extract data from a database which has different text and dates (ex. 01/03/07, 05/29/08, 06/05/08). Once the file is created I need to grep for all the text with a current date then redirect the sorted data to another file then email the file out. Here is what I have right now. My question is how could I incorporate the date command to only output the current date automatically?
awk '{print $1 $2 $3 $4 $5}'|egrep
05/29/08 $MYHOME/all.sched > $MYHOME/all.scheda
more $MYHOME/all.scheda|mail -s "scheda"
xxxxxx@xxxx.com < $MYHOME/all.scheda
OUTPUT:
servera schedule_1126 bob 05/29/08
serverb schedule_703 bob 05/29/08
serverc schedule_FRI2 mary 05/29/08
serverd schedule_FRI2 jane 05/29/08