Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Answer: 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 ( #147203=categorized answer: print w/replies, xml ) Need Help??

Q&A > input and output > How do I send passwd via Expect.pm w/o printing it clear text to screen - Answer contributed by zengargoyle

I think you want:

[ qr'ssword: ', sub { $spawn_ok=1; $scp->stty('-echo'); # echo off print $scp ("password\n"); $scp->stty('echo'); # echo on exp_continue; } ],

(untested, don't have Expect installed)

  • Comment on Answer: How do I send passwd via Expect.pm w/o printing it clear text to screen
  • Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[Discipulus]: echo 'a'\'' gives me the prompt and then go with error on ctrl-d
[Discipulus]: uch! worst than windows!
[marto]: It's not worse, just different. Different shells, different tools. Different ways
[choroba]: Perl to the rescue!

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2017-11-24 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (346 votes). Check out past polls.

    Notices?