sorry about the last post, it didn't work (at least with my version of awk) This timescript will give you both outputs in a file called time_statfile.
first run
bash-2.05$ timescript>time_statfile
here is timescript:
#!/bin/bash
perl -e '$TheDate=localtime;
print "The time is $TheDate.\n";'
vmstat
you can see the output here:
bash-2.05$ cat time_statfile
The time is Fri Jul 22 15:09:07 2005.
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr s6 sd -- -- in sy cs us sy id
0 0 0 2531368 683488 28 51 111 7 7 0 0 0 3 0 0 539 1232 1338 1 6 92
just rememeber that if you do timescript>time_statfile it will rewrite the file, otherwise append it so you can keep a log of it. Be careful how much this log grows.
Good luck with it