From: Igor Pirnovar Date: 2012-10-29T03:25:18+09:00 Subject: Re: Passing folder as argument ARGV? First ARGV is an array of all arguments to Ruby program. So regardless of which OS you are using, do something like the following: my_var = ARGV[0] dir = File.expand_path(my_var) Dir["#{dir}/*"].each {|f| puts f } Or depending on wether you need the full file path name or just bare filename, something allong the following: p Dir["#{File.expand_path(my_var)}/*"] p Dir["#{File.expand_path(my_var)}/*"].each.map { |f| File.basename(f) } Regards, igor -- Posted via http://www.ruby-forum.com/.