in reply to Submitting password changes to external program

Programs like passwd tend to re-open /dev/tty themselves to read from rather than using STDIN. You need to use something like Expect to run it on its own pty instead.

  • Comment on Re: Submitting password changes to external program

Replies are listed 'Best First'.
Re^2: Submitting password changes to external program
by Dietz (Curate) on Dec 09, 2005 at 14:11 UTC

    Does this mean that /dev/tty gets re-opened by passwd and such programs after I redirect STDOUT to /dev/tty?

      Yes, passwd ignores its STDIN and opens /dev/tty to read the password from.