Use gSytem to run system cmds

Hi,
System commands can be executed via, for example:

gSystem->Exec(“date”);

. The command will print the date on my screen. In a ROOT macro, how can I redirect the printout of the command to a string variable? Do not tell me I can use the class TDatime. 8)

Thank you,
Zhiyi.

virtual TString GetFromPipe(const char* command)

from root.cern.ch/root/html/TSystem.html

does this work?

gSystem->GetFromPipe("date");
Rene

Thank you, guys! That is what I exactly want.