The passwd program usually (if not always) expects a TTY - so you either
have to fake it out with something like Expect.pm (do a google search on
change password passwd Expect.pm perl) or use a stream of commands fed
into vipw (including the new password encrypted) to do the dirty work.
I would think the Expect route to be easiest.
Luke
On Tue, 3 Jul 2001, Tarik Jeait wrote:
> Hi,
> can somebody tell me how to change my unix passwd by a perl script
> :
>
> open(FILE,"|passwd"); --> doesn't work ;
>
> must I open some pipe or What ?
>
> T.J
>
> Thank you
>