From: Marc Weber Date: 2010-04-09T20:48:45+09:00 Subject: Re: How to capture output of linux command Learn about Dir object. It has methods such as glob which should give you directory contents. Then you don't have to care about stdout, nor quoting. http://whynotwiki.com/Comparison_of_Escape_class_and_String.shell_escape Have a look at the first example here Marc