Re: Newbie Question

From: Icarus Sparry (usenet_at_icarus.freeuk.com)
Date: 12/29/03


Date: Mon, 29 Dec 2003 06:39:35 GMT

Greg Hines wrote:

> Hi all,
>
> The following command in SCO OSR 5.0.5
>
> passwd -m ksh
>
> will change the dialup passwd for all shells that end with ksh. It will
> prompt you for the password and then confirmation of the password.
>
> What I want to do is put all this in a script, with the password and
> confirmation (ie the password twice) so the user does *not* have to type
> the password twice.
>
> Can it be done?
>
> Greg
Standard question, with standard answer 'use expect'.
If this is not available, then script telnet, e.g.

{
        sleep 5
        echo username
        sleep 5
        echo login_password
        sleep 10
        echo 'passwd -m ksh'
        sleep 5
        echo new_dialup_password
        sleep 5
        echo new_dialup_password
        sleep 5
        echo 'exit'
        sleep 5
} | telnet localhost