perlknight has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (input and output)
sub copyover { my $scp=Expect->spawn("/usr/bin/scp -r \"$srcpath\" ${dest_hos +t}:$destpath"); my $spawn_ok; $scp->expect(30, [ qr'ssword: ', sub { $spawn_ok=1; print $scp ("password\n"); exp_continue; } ], [ qr'yes/no', sub { $spawn_ok=1; $scp->send("yes\n"); exp_continue; } ], '-re', qr'[#>:] $', #' ); $scp->soft_close(); return; }
Originally posted as a Categorized Question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I send passwd via Expect.pm w/o printing it clear text to screen⭐
by zengargoyle (Deacon) on Feb 24, 2002 at 20:10 UTC | |
|
Re: How do I send passwd via Expect.pm w/o printing it clear text to screen
by zengargoyle (Deacon) on Feb 24, 2002 at 20:52 UTC | |
|
Re: How do I send passwd via Expect.pm w/o printing it clear text to screen
by perlknight (Pilgrim) on Feb 25, 2002 at 01:43 UTC |