in reply to How to enter password through a file when it prompts on STDOUT.

Maybe you should use the parameter password, not passowrd.

But generally speaking, you don't use system if you want to feed something into a spawned command's STDIN - you use open $fh, "|-", "$program @args"; - you are out of luck, though, if a program reads directly from /dev/tty (e.g. /usr/bin/passwd).

Replies are listed 'Best First'.
Re^2: How to enter passowrd through a file when it prompts on STDOUT.
by Fletch (Bishop) on Aug 18, 2010 at 14:36 UTC

    Your not completely out of luck if it reads from the controlling tty directly but you will require stronger magic, such as Expect or IPC::Run which will run things on a pty.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.