Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: expect and adduser

by marvell (Pilgrim)
on Oct 14, 2005 at 11:44 UTC ( [id://500207]=note: print w/replies, xml ) Need Help??


in reply to expect and adduser

I've narrowed it down to passwd

my $exp = Expect->new("passwd fred") or die "Cannot spawn: $!\n"; $Expect::Exp_Internal = 1; my $timeout = 5; $exp->expect($timeout, [ qr/UNIX password:/ => sub { my $exp = shift; $exp->send("sponge\n"); exp_continue; } ], ); $exp->soft_close();

Get either timeout, but add a ; to the end of the command and it works fine.

Update: that's not true, it sometimes fails

--
Steve Marvell

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://500207]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-20 00:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found