Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail file with date of today

Status
Not open for further replies.

blueeyedme

Technical User
Nov 27, 2002
39
0
0
NL
Hi,

I have a script which generates a file every day. This file looks like this 20040123.txt (date).
How do i get my mail command in this way that it always picks todays file?

Regards,

Jeroen
 
define a variable for the date part of the file

DATE=`date +%Y%m%d`

define the filename

FILE= $DATE.txt

send the mail

mail <usual args> < $FILE

Is that the kind of thing you mean ?

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top