prad001 has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, I have a situation where in I am calling the below Perl script
if (param("lremail") && param("lot")) { my $address=param("lremailaddress"); my $lot=param("lot"); print a({-href=>"$dir/new.pl"},"Back to Top"),br; print "Request submitted for $address.",br; print "Lot $lot",br; print "You will receive an e-mail with a link to the data when the + request is complete."; print end_html; system ("ssh SERVERNAME /test/abc.csh $lot $$ $address &"); exit(1);
The above script does not run because, when I execute the script its asking for a system password. Then I researched a little and wrote the below command..
expect -c 'spawn ssh SERVERNAME /test/abc.csh J213520 06 abc@gmail.com + "ls -lh file"; expect "Password:"; send "PASSWORD\r"; interact'
Now this command is executed successfully without any issue but from the command line only. When I incorporate the same(by replacing the system call) within the Perl script, it fails. How can I incorporate this line within the perl script?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to incorporate Expect in Perl Script? OR Pass the password via perl script?
by Corion (Patriarch) on Jul 12, 2022 at 15:16 UTC | |
by prad001 (Initiate) on Jul 13, 2022 at 12:51 UTC | |
Re: How to incorporate Expect in Perl Script? OR Pass the password via perl script?
by atcroft (Abbot) on Jul 13, 2022 at 03:11 UTC | |
by Fletch (Bishop) on Jul 13, 2022 at 10:48 UTC | |
Re: How to incorporate Expect in Perl Script? OR Pass the password via perl script?
by tybalt89 (Monsignor) on Jul 12, 2022 at 20:59 UTC | |
Re: How to incorporate Expect in Perl Script? OR Pass the password via perl script? (plz stop reposting)
by LanX (Saint) on Jul 12, 2022 at 15:08 UTC |
Back to
Seekers of Perl Wisdom