Creating timestamped directories/files in expect

Hi,

I am looking for the syntax to provide a timestamped log_file in expect.

Basically I want the equivalent of:

/outputs/`date +%d%m%y`/session`date +%H%M`

But scripted in expect so it can be handed over to the logfile function.

I have tried playing around with the timestamp command but it doesn't appear to accept it when specifying it together with log_file.

Does anybody know what the correct syntax for this would be.

Kind regards and many thanks in advance,

K

---------- Post updated 14-04-11 at 12:31 PM ---------- Previous update was 13-04-11 at 05:02 PM ----------

Managed to get it working by predefining variables:

set date [timestamp -format %d%m%y]
set time [timestamp -format %H%M]
/outputs/$date/session$time

It appears that this cannot be predefined inline.

I have done this with a trivial C program, piping the log stream stdin to stdout, putting a time stamp in front of the first character of each (not blank?) line. When C read()'s one byte at a time, it tends to force lowest latency. In ksh on /dev/fd/ systems and in bash, you can make the log file >(...), or you can manage a named pipe.