Simple Tcl problem

Hi

I want to write some small Tcl scripts to improve useage. I’ve just started to learn Tcl and have a very basic problem.

This is an example:

> set test [mdh 0xFFFFF800]
0xfffff800:   20 
> set test                 
>

With the first command the MMR at address 0xFFFFF800 should be store into variable test. The mdh command has been executed and the result is displayed. But for some reason test seems to be empty.

How can I use and store the result from OpenOCd commands?

I use version 0.2 and have connected with telnet.

Best regards,