- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Expect script - ftp problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2005 12:22 AM
06-02-2005 12:22 AM
One of them works without a problem, however, the second one seems to stop at the Password prompt.
I generated the expect script also for the problematic script using autoexpect.
I have attached my script.txt file.
Any suggestions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2005 02:16 AM
06-02-2005 02:16 AM
Re: Expect script - ftp problem
[snipped]
expect -exact "\r
331-Connected to destsite.r
331-welcome to destsite access restrictions apply. Time = 07:45:30\r
331 Password required for userid.\r
[snipped]
After entering the userid, the script expects the above output (you can notice the use of 'exact' keyword). But since the time is dynamic, it does not matches with '07:45:30' everytime you run it. Moreover the timeout has been set to infinite, hence it hangs.
You need to change the autoexpect script to allow flexible output from ftp. Replace the above lines with the below line and try.
expect "Password:"
You can also set the timeout to some seconds.
set timeout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2005 02:38 AM
06-02-2005 02:38 AM
Re: Expect script - ftp problem
dont make expect very strict, it does not like it some times.
modify your script to expect for password: and continue with it. also always give a timeout in scripts so that the script never gets blocked for any reason.
Regards,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2005 05:15 AM
06-02-2005 05:15 AM
Re: Expect script - ftp problem
Now, it seems to hang on the exit.
When I run the ../expect script.exp, it runs, transfers the file and it returns with the ftp> prompt.
Nickd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2005 05:26 AM
06-02-2005 05:26 AM
Re: Expect script - ftp problem
I had some more expect exacts that it was looking for.
If you wan full points, please reply and I will assign for you.
You gotta love this forum.
nickd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2005 05:10 PM
06-02-2005 05:10 PM
Solutionwho does not want full points :)
here is the other problem you faced and fixed.
after put, you are expecting
200 PORT command successful.\r
150 Opening ASCII mode data connection for nd.test.\r
226- Transfer complete - acknowledgment message is pending.\r
226- Transfer complete - acknowledgment message is pending.\r
226 Transfer complete (Batch Number = 8150).\r
115 bytes sent in 0.01 seconds (10.09 Kbytes/s)\r
of this the final output line could change everytime depending on your bandwidth (10.09 kbytes/s) so remove that line and you should be safe.
Regards,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2005 05:37 PM
06-02-2005 05:37 PM
Re: Expect script - ftp problem
ftp -i -n
open
get file
put file
bye
EOF
It will do it easily.
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2005 12:06 AM
06-03-2005 12:06 AM
Re: Expect script - ftp problem
I had to use expect due to the fact that I needed to connect to a specific outbound ftp proxy first.
Then, I needed to connect to the outside ftp site using the account@ftpsite.com and password type of idea.
Thanks.
Nick