beginner question

M

Mikael Larsson

Hi all
Is there any standard way to do or mimic this shell construction in ruby

someprog << STOP
file1.dat

file2.dat
30
STOP

Regards,
//Mike
 
R

Robert Klemme

Mikael Larsson said:
Hi all
Is there any standard way to do or mimic this shell construction in ruby

someprog << STOP
file1.dat

file2.dat
30
STOP

Regards,
//Mike

From memory

popen("someprog") do |io|
io.print <<STOP
file1.dat

file2.dat
30
STOP
end

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,147
Messages
2,570,835
Members
47,382
Latest member
MichaleStr

Latest Threads

Top