From: Jan Svitok Date: 2007-03-05T20:48:10+09:00 Subject: Re: IO.popen puts On 3/5/07, Rebhan, Gilbert wrote: > > Hi, > > i want to do a cvs login for a list of cvsrepositories > with IO.popen > > the normal login via Windows shell looks like = > > Y:\>cvs -d :pserver:username@cvshost:d:/cvsrepos/test login > Logging in to :pserver:username@cvshost:2401:d:/cvsrepos/test > CVS password: ******** > > > i tried with = > > cvsrepos=%w[test,test1,test2] > cvsrepos.each {|x| > IO.popen("#{CVSEXE} -d #{CVSROOT}/#{x} login", 'r+') do |pipe| > pipe << "password" > pipe.close_write > puts pipe.read > end > } > > but the script hangs with the output > CVS password: > > What went wrong ? just a guess: 1. try adding newline 2. try redirecting stdin on the command line without ruby (maybe cvs reads the keyboard directly)