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
|
|---|