From: "Sebastian W." Date: 2009-01-15T06:12:57+09:00 Subject: Re: Net::SSH serialized commands lyrics wrote: > Hi, > I am using Net::SSH v2 > I want to execute a command when the first one is complete. > But I can't make it working. > Here is my code: > > Net::SSH.start( addr, user, :password => passwd) do |session| > session.exec! ("service X restart") > session.exec!("") > end > > The issue is that the second "session.exec!" is executed before > service is restarted. > > I guess I am not doing the right way but I don't know how to do it. > Can someone help me,please? > > lyrics Not sure if this would accomplish what you are looking for, but you could try just doing this: Net::SSH.start( addr, user, :password => passwd) do |session| session.exec! ("service X restart; ") end -- Posted via http://www.ruby-forum.com/.