in reply to Calling interactive programs from with a script

Hi,
First, look here for formatting your post.
Second, this is really a unix question, not a perl one, since this is the way passwd works.
Please look at Expect for some clues how to solve your problem.

Yours,
---------------------------
Dr. Mark Ceulemans
Senior Consultant
IT Masters, Belgium

  • Comment on Re: Calling interactive programs from with a script

Replies are listed 'Best First'.
Re: Re: Calling interactive programs from with a script
by thor (Priest) on Aug 28, 2002 at 12:48 UTC
    Second, this is really a unix question, not a perl one, since this is the way passwd works.
    I disagree. He's not having problems with passwd per se, he's having problems accessing it through perl. There is a difference.

    As for the original question, I think that part of the problem can have some light shed on it by the answer to the question "where do stdout and stderr go when you do a system call?" . Also, passwd expects a tty to be communicating with it, and has provisions to prevent things like scripts interfacing with it. Fortunately for you, Expect.pm is around. Expect simulates a tty, allowing you to script an interface to things like passwd.

    thor