Gordon Thiesfeld
5/3/2008 12:09:00 PM
On Sat, May 3, 2008 at 7:02 AM, Raveendran Jazzez <jazzezravi@gmail.com> wrote:
> i did this already. But need to get in a single variable. I think it is
> not possible. Anyway thanks a lot ..
>
Use backticks:
>> a = `ipconfig`
=> "\r\nWindows IP Configuration\r\n\r\n\r\nEthernet adapter Wireless
Network Connection 2:\r\n\r\n Connection-specific DNS Suffix .
: \r\n IP Address. . . . . . . . . . . . : 192.168.1.101\r\n
Subnet Mask . . . . . .
. . . . : 255.255.255.0\r\n Default Gateway . . . . . . . . .
: 192.168.1.1\r\n"
>> a
=> "\r\nWindows IP Configuration\r\n\r\n\r\nEthernet adapter Wireless
Network Connection 2:\r\n\r\n Connection-specific DNS Suffix .
: \r\n IP Address. . . . . . . . . . . . : 192.168.1.101\r\n
Subnet Mask . . . . . .
. . . . : 255.255.255.0\r\n Default Gateway . . . . . . . . .
: 192.168.1.1\r\n"
>>