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?
In reply to How to incorporate Expect in Perl Script? OR Pass the password via perl script? by prad001
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |