--20cf300514749eef5404ac745e91 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable El 08/09/2011 17:27, "Robert Klemme" <shortcutter / googlemail.com> escribi > > 2011/9/8 Jesù¸ Gabriel y GaláÏ <jgabrielygalan / gmail.com>: > > On Thu, Sep 8, 2011 at 3:35 PM, dwight schrute <spambocks / yahoo.ca> wrote: > >> Hi, > >> > >> I have this simple loop: > >> > >> (1..12).each do |i| > >> puts "t#{i}.showURL" > >> end > >> > >> Which produces the following output: > >> > >> t1.showURL > >> t2.showURL > >> t3.showURL > >> t4.showURL > >> t5.showURL > >> t6.showURL > >> t7.showURL > >> t8.showURL > >> t9.showURL > >> t10.showURL > >> t11.showURL > >> t12.showURL > >> > >> > >> > >> My question is this: How can I actually execute the output of the > >> script? (I want to execute the output, not just have it printed to the > >> screen) > >> > >> In bash, I would use backticks `` or dollar-bracket $() > > > > backticks also work in Ruby. Also system or %x{}: > > > > (1..12).each do |i| > > `t#{i}.showURL` > > end > > > > (1..12).each do |i| > > sytem("t#{i}.showURL") > > end > > > > (1..12).each do |i| > > %x{t#{i}.showURL} > > end > > There's also exec and if one wants to collect the output there is > IO.popen and Open3.popen... > > Initially I had thought (and apparently Isaac did as well) that the > task at hand was to execute Ruby code. yes, it seems I misunderstood the question. Sorry for the noise. Jesus --20cf300514749eef5404ac745e91--