Im running this command from ruby script:
system "trad install"
This will prompt me three times for choosing y/n.
Is there a way to automatically choose y,y,n?
Im running this command from ruby script:
system "trad install"
This will prompt me three times for choosing y/n.
Is there a way to automatically choose y,y,n?
well, you might want to use
pipe = IO.popen("trad install")
pipe.write "yyn"
Not sure if that works, however.
I don't think you can do that. If trad is your application, the best way is to add options to it.
You can probably automate a run with Session and Ruby's built-in pty
/expect
(which seems to have no online documentation). (Dave Thomas has a few brief examples of expect
and pty
in recent editions of Programming Ruby, if you have a copy of that.)
However, I agree with Dmitry: it's almost certainly easier to adjust trad
if possible.