I'm trying to format a bash shell script for my Linux server. I'm going to need the script to call out a specific command:

/opt/rational/base/cots/flexlm.11.8/i386_linux2/lmstat -a
This is simple however I'm confused since I've never created any scripts before. When that command is ran in Bash, the output needs to be dumped into a text file with the date:time.txt formatted as the file name. I then need this file to be emailed to one specific email address. Now my question is do I format all of the above into the Bash script including the email part or should that be done / called out in the Crontab line when the script's going to be executed? I don't know what good protocol is here so please if you can tell me what I should do...

Once the script is done, I'm capable of formatting a Crontab line entry on how often the script needs to be executed.

Thanks for any info!