From: Dragoescu Daniel Date: 2007-11-07T17:58:42+09:00 Subject: Assigne command ouput to a variable ------=_NextPart_000_0001_01C8212D.07AD4520 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello guys! I am a newbie in ruby and i have a question. I run a system command and i want that the ouput of that command to be assigne to a variable, something like this: var1 = system("du -s /mnt/hdd/ | cut -f1") puts var1 or var1 = exec("du -s /mnt/hdd/ | cut -f1") puts var1 but system return 0 or 1 if command is failed or succesful, and exec don't assigne the output to variable var1. Can you help me? Thanks in advance. ------=_NextPart_000_0001_01C8212D.07AD4520--