Dear Concern,
I want to run following script in RHEL 6.3.
[biuser@blbidb01 daily_bkash_itopup_detail]$ cat sftp_upload.sh
#!/usr/bin/expect
spawn sftp -oPort=434 bkashtopup@172.16.252.59
expect "*?assword:*"
send "bkashtopup1234\n"
send "lcd /BI/application/report/script/daily/daily_bkash_itopup_detail\r"
expect sftp>
send " mput *.gz\r"
expect sftp>
send "exit\r"
expect eof
When try to execute the command in debug mode, got followg error message.
Please help me in this issue.
[biuser@blbidb01 daily_bkash_itopup_detail]$ sh -x sftp_upload.sh
+ spawn sftp -oPort=434 bkashtopup@172.16.252.59
sftp_upload.sh: line 2: spawn: command not found
+ expect '*?assword:*'
couldn't read file "*?assword:*": no such file or directory
+ send 'bkashtopup1234\n'
sftp_upload.sh: line 4: send: command not found
+ send 'lcd /BI/application/report/script/daily/daily_bkash_itopup_detail\r'
sftp_upload.sh: line 6: send: command not found
sftp_upload.sh: line 7: syntax error near unexpected token `newline'
sftp_upload.sh: line 7: `expect sftp>'
With Best Regards,
Md. Abdullah-Al Kauser
---------- Post updated at 02:19 PM ---------- Previous update was at 01:20 PM ----------
Dear concern,
[root@blbidb01 ~]# which expect
/usr/bin/expect
[root@blbidb01 bin]# rpm -qa|grep expect
pexpect-2.3-6.el6.noarch
With Best Regards,
Md. Abdullah-Al Kauser
---------- Post updated at 02:47 PM ---------- Previous update was at 02:19 PM ----------
Dear concern,
Correction Please.
[root@blbidb01 ~]# rpm -qa |grep expect
pexpect-2.3-6.el6.noarch
expect-5.44.1.15-4.el6.x86_64