From: Steve Pauly Date: 2010-07-02T04:53:48+09:00 Subject: Running a shell command from ruby I am experimenting with running bash commands from within ruby. The commands should be in an array, separated internally with semicolons. The problem is that they do not get executed. My script: ---- #!/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. But why do the files f1 and f2 not get created? I realize that executing commands this way in ruby may be bad practise, but at least, why do the commands not execute? Thanks in advance. Steve. -- Posted via http://www.ruby-forum.com/.