From: Jean-Julien Fleck Date: 2010-07-19T17:04:08+09:00 Subject: Re: capture STDOUT data to a variable Hello Shaun, > I am fetching some data from windows using a simple ruby script using > system command, which is outputting the data onto STDOUT. But I need the > same to get dumped to a local variable. > how can I acheive this? the code snippet I am using is as below > > result = system("D:\\softwares\\devcon.exe find *") If it works on windows as it does on Mac and Linux, you just have to use backsticks: result = `D:\\softwares\\devcon.exe find *` You could also look at IO.popen to get a bit more flexibility. Cheers, -- JJ Fleck PCSI1 Lycée Kléber