From: Brian Candler Date: 2011-04-08T22:32:48+09:00 Subject: Re: reading and writing to child process with streams in ruby mpurdy wrote in post #991644: > echo -n "username: " You are sending just "username: " without a trailing newline. > line = stdout.read Here you are reading from stdout until the end-of-file (i.e. until the other side terminates or closes the file). This will wait forever. Two possible solutions: 1. Change your shell script to send data ending with a newline, then use 'gets' in the ruby code. 2. More generally, use expect.rb in the standard library. Then you can wait for a particular sequence of characters, e.g. /name: /, before continuing. HTH, Brian. -- Posted via http://www.ruby-forum.com/.