I\'m using IO.popen in Ruby to run a series of command line commands in a loop. I then need to run another command outside of the loop. The command outside of t
IO.popen
for foo in bar out = IO.popen(cmd_foo) out.readlines end IO.popen(another_cmd)
Reading the output to a variable then calling out.readlines did it. I think that out.readlines must wait for the process to end before it returns.
out.readlines
Credit to Andrew Y for pointing me in the right direction.