Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

How to incorporate Expect in Perl Script? OR Pass the password via perl script?

by prad001 (Initiate)
on Jul 12, 2022 at 14:46 UTC ( [id://11145446]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if (param("lremail") && param("lot")) {
        my $address=param("lremailaddress");
    ...
        print end_html;
        system ("ssh SERVERNAME /test/abc.csh $lot $$ $address &");
        exit(1);
    
  2. or download this
    expect -c 'spawn ssh SERVERNAME /test/abc.csh J213520 06 abc@gmail.com
    + "ls -lh file"; expect "Password:"; send "PASSWORD\r"; interact'
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found