in reply to How to cpture output of interactive command using perl.?

I know I can not use back tick (`) because, it won't be interactive then. I can't use system() because system will run the command in interactive mode, but I will not be able to capture the output of the command.

You're going to have to elaborate on exactly what you are trying to do.

Reading between the lines, it sounds like you might be looking for an Expect type of thing. (Be warned: As far as I know, noone has got this to work on windows.)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re: How to cpture output of interactive command using perl.?

Replies are listed 'Best First'.
Re^2: How to cpture output of interactive command using perl.?
by Rapunzel (Novice) on Dec 11, 2008 at 07:04 UTC
    * Do you want the command to interact with your script? Or the user? Rapunzel: Command will interact with user. * If the latter, are you hoping to capture just the final output, or the entire interaction including user inputs and intermediate command outputs (eg. prompts)? Rapunzel: It is fine even if script is able to capture the final output. Also note that my script supports both windows and *nix operating system.