From: "A. Lester Buck III" Date: 2008-06-09T04:13:54+09:00 Subject: How to redirect $stdin to read from a string? Hi, I want to send a Windows popup from a Linux machine. smbclient is the standard utility, and it will accept a file on standard input to avoid terminal interaction, viz. smbclient -M netbiosname < /tmp/message.text From my reading of the Ruby Cookbook, recipes 6.15 and 6.16, this "should" work: ========= #!/usr/bin/ruby -w require 'stringio' $stdin = StringIO.new "This is the test message" system("smbclient -M netbiosname") ========= Alas, it ignores the input message and prompts for terminal input terminated by ^D. Could someone please show me the correct code to use in a Ruby script to send a string to a Windows popup? Thanks a lot! Lester