Jul 29, 2010, 10:17 PM
Post #1 of 1
Automating Password entry(involving git)
I am trying to use expect to automate the password entry process with git pull. I am able to understand and use expect.pm 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.
my $exp = Expect->new();
if($exp->expect(1, '-re', '.*?password.*'))
$exp->send("ls -al > /tmp/ls.txt\r");
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.