CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Automating Password entry(involving git)


New User

Jul 29, 2010, 10:17 PM

Post #1 of 1 (3436 views)
Automating Password entry(involving git) Can't Post


I am trying to use expect to automate the password entry process with git pull. I am able to understand and use and verified it on "ssh -l server" command, but when i replace the command with "git pull" the script doesnt work. Following is the script am using and the error i get.


use Expect;
use strict;

my $exp = Expect->new();
$exp->spawn("git pull");

if($exp->expect(1, '-re', '.*?password.*'))
$exp->send("ls -al > /tmp/ls.txt\r");
warn("inside else\n");

After spawning the command, the control always enters in to else part. I tried with different regular expression patterns but it never works.. I have even tried with regular expression of ".*+.*", in this case the if part got executed but the "send" is not able to do its job.

Can somebody please help me
1)Understand why is the problem with git.
2)any other way of automating the password entry in perl using any other mechanis.

Thanks in anticipation.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives