Not able to execute the file in remote host using except utility
I am automating the SFTP keys setp process:
So i created the expect script for controlling the output of shell
below is my main code:
Code:
#!/usr/bin/expect
set fd [open ./pass r]
set password [read -nonewline $fd]
close $fd
set df [open ./app r]
set app [read -nonewline $df]
close $df
spawn ssh servername << pb
Pb file:
Code:
set df [open ./app r]
set app [read -nonewline $df]
close $df
spawn pbrun pbmigr $app=ksh
expect "Password:"
send "MY PASSWORD “
interact
when i execute thhis script ..it runs fine but it is not doing ssh
and when i remove pb then it is working fine.and when i executing pb file alone..it is working
can anyone pls help me?