Windowsのコンソールからだと、
文字コードの関係か、どうもうまくMozReplのコマンドがが使えなので、
UTFで.rbをかいてrubyから操作したら無事できた。
↓こんな感じにするとコマンドラインから
↓c:>ruby replWrapper.rb repl.inspect(content)
↓とかできる。

require 'nkf'
require 'net/telnet'

$KCODE = 'u'
replCommand = NKF.nkf("-S-w", ARGV[0]).chomp
prompt = /^repl\d*>/

telnet = Net::Telnet.new({
 "Host" => "localhost",
 "Port" => 4242,
 "Prompt" => prompt,
})

telnet.waitfor(prompt)
telnet.cmd(replCommand) do |c|
 print c.gsub(prompt, "")
end

telnet.close