- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: FTP commands in the shell scripts
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
Discussions
Discussions
Forums
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
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
тАО04-24-2001 10:19 PM
тАО04-24-2001 10:19 PM
I need write a scripts with ftp commands.
for example:
------------
#!/usr/bin/sh
cd /home/user1
ftp machine
user_name
passwd
get file
bye
exit 0
------------------
I have no idea how to do it. :-(
I guess that it is so stupid but ...
Could you anyone help me ?
Thanks Radim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2001 10:23 PM
тАО04-24-2001 10:23 PM
Re: FTP commands in the shell scripts
you're already close. Redirect standard input to the ftp command, all following lines will be handled like you would type them until the marker (here EOT) is found.
ftp machine << EOT
user_name
passwd
get file
bye
EOT
good luck,
Thierry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2001 10:35 PM
тАО04-24-2001 10:35 PM
Re: FTP commands in the shell scripts
wow, so fast response :-).
I've already tried to use here doc but it didn't work as I excepted. I got to the passwd prompt only.
Radim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2001 10:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2001 11:03 PM
тАО04-24-2001 11:03 PM
Re: FTP commands in the shell scripts
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xffe5f841489fd4118fef0090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2001 11:04 PM
тАО04-24-2001 11:04 PM
Re: FTP commands in the shell scripts
ftp -n server << EOT
user theuser thepassword
cd thedirectory
get thefile
bye
EOT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2001 11:26 PM
тАО04-24-2001 11:26 PM
Re: FTP commands in the shell scripts
What's surprise! It's working :)
Thanks for your help
Radim
p.s. Points are coming ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2001 01:42 AM
тАО04-26-2001 01:42 AM
Re: FTP commands in the shell scripts
I was toying with using crypt somehow but you would still need to have the crypy key available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2001 10:59 AM
тАО04-26-2001 10:59 AM
Re: FTP commands in the shell scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2001 11:25 AM
тАО04-26-2001 11:25 AM
Re: FTP commands in the shell scripts
I aggree about the password issue.
I've been thinking about it too; but haven't got any further than creating FTP accounts with very very very limited privileges.
Also the script should be kept away from hungry eyes ;)
Thierry.