From: Brian Buckley Date: 2010-07-02T08:43:04+09:00 Subject: Re: Running a shell command from ruby > #!/usr/bin/ruby > script1=["touch ~/ruby/f1;touch ~/ruby/f2"] #addl array elements to > be added > puts script1[0].split(/;/) do |k| > puts k > system(k) > end > ---- > The output from "puts k" looks good. Your block is not being called. I think the output you are seeing the is from the first "puts", not the "puts" inside the block. You need to call "each" on the Array returned by split, like this: puts script1[0].split(/;/).each do |k| puts k system(k) end --Brian -- Posted via http://www.ruby-forum.com/.