# IO.popen puts

**URL:** <https://www.ruby-forum.com/t/io-popen-puts/87701>\
**Category:** Ruby\
**Created:** [March 5, 2007, 10:50am UTC](https://www.ruby-forum.com/t/io-popen-puts/87701 "2007-03-05T10:50:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RebhanS\_Gilbert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@RebhanS\_Gilbert](https://www.ruby-forum.com/u/RebhanS_Gilbert)\
**Post date:** [March 5, 2007, 10:50am UTC](https://www.ruby-forum.com/t/io-popen-puts/87701/1 "2007-03-05T10:50:01Z")

</div>

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 ?

Regards, Gilbert

---

<div class="post-metadata">

**Author:** ![RebhanS\_Gilbert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@RebhanS\_Gilbert](https://www.ruby-forum.com/u/RebhanS_Gilbert)\
**Post date:** [March 5, 2007, 12:49pm UTC](https://www.ruby-forum.com/t/io-popen-puts/87701/2 "2007-03-05T12:49:16Z")

</div>

On 3/5/07, Rebhan, Gilbert [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> CVS password: \*\*\*\*\*\*\*\*  
> 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)

---

<div class="post-metadata">

**Author:** ![RebhanS\_Gilbert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@RebhanS\_Gilbert](https://www.ruby-forum.com/u/RebhanS_Gilbert)\
**Post date:** [March 5, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/io-popen-puts/87701/3 "2007-03-05T15:08:42Z")

</div>

Hi,
