From: "Eric C." Date: 2010-12-01T10:07:26+09:00 Subject: Entering password in shell HI: I'm trying to run a shell to install a gem: PTY.spawn("sudo gem install #{gem} --local 2>&1") do |stdin,stdout,pid| stdout.write("#{pass}\n") puts stdin.read.lstrip #write output to screen end This works fine if the password is correct. However, if the password is not correct it hangs. I've tried this line too: stdout.write("#{pass}\n\n\n\n\n\n") to try to get it to terminate, but it still hangs. Is there a way to enter passwords into the command line or enter them ahead of time? Thanks, Eric -- Posted via http://www.ruby-forum.com/.