> use strict; > use warnings; > use Expect; > use IO::Tty; > > $host = "192.168.1.72"; > $passwd= "xyz"; > $user = "xyz"; > > $t= "file.txt"; > my $connect = Expect->spawn("scp $t [EMAIL PROTECTED]:/work/$user/"); > $connect->expect(30,"\s") ||die "junk1";
> print $connect $passwd."\n"; Do you want to send the password?, let expect wait for the prompt $connect->expect(30, "word:"); $connect->send("$passwd\n"); > $connect->expect(30,"-re",'$\s'); > $connect->soft_close(); > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/