From: Daniel Harple Date: 2006-03-27T01:13:32+09:00 Subject: Re: String to array as command line On Mar 26, 2006, at 6:03 PM, lubomir.markovic@gmail.com wrote: > Hello, > > I can't find a function that takes a string as an input, parses it and > returns an array in the exactly same way as command line is parsed > into > ARGV array variable. > Could you give me a hint? > > Thanks in advance > Lubos require 'shellwords' args = Shellwords.shellwords('foo\ bar "another shellword"') # => ["foo bar", "another shellword"] -- Daniel