First: do you need to delay before passing the password (as suggested above)? ie. after opening your process put your process to sleep(5); to give your subprogram time to start up and ask the password question?
Secondly: some programs, like passwd on linux, use tricks to ensure you can't just pass input via STDIN - this is to prevent nasty hacks that bypass security. To get around this a language called TCL/Expect is commonly used for applications that need to call passwd (the trick used is to log in again and execute the program through a login shell). That is why I suggested a Perl-equivalent, Expect. It is possible that the program you're using needs special handling like the linux passwd program.
In reply to Re^3: passing in User Input
by monarch
in thread passing in User Input
by slloyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |