- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- FTP through script
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
тАО05-29-2008 04:25 AM
тАО05-29-2008 04:25 AM
FTP through script
Please ignore my knowledge,I am very new to Unix
I am running following code to perform ftp from remote machine.
but i am getting an error -test1: Syntax error at line 4 : `<<' is not matched
please see the code -
ftpthefile()
{
ftp -n <
user gbx wbo\$2008
get /dnbusr1/gbx/audit/gb200804.txt /dnbusr1/gbx/gb200804.txt
bye
EOT
}
exit 0
- Tags:
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-29-2008 04:35 AM
тАО05-29-2008 04:35 AM
Re: FTP through script
check for spaces in front of the "second" EOT
They are not allowed.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-29-2008 04:38 AM
тАО05-29-2008 04:38 AM
Re: FTP through script
Make sure that your end-of-file marker (the 'EOT' word) is flush left without leading whitespace.
You may use leading *tab* characters only if you use '-<
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-29-2008 04:38 AM
тАО05-29-2008 04:38 AM
Re: FTP through script
#!/usr/bin/sh
ftpthefile()
{
ftp -n <
user gbx wbo\$2008
get /dnbusr1/gbx/audit/gb200804.txt /dnbusr1/gbx/gb200804.txt
bye
EOT
}
ftpthefile
exit 0
BTW, I'd prefer to use .netrc:
machine flinux1
login admin
password Adm1n
macdef init
ascii
by
quit
Between macdef init and by you can put all needed commands and run just
ftp flinux1
by the user in whos homedir you have such .netrc
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-29-2008 06:54 AM
тАО05-29-2008 06:54 AM
Re: FTP through script
you might find wget easier to use.
http://www.gnu.org/software/wget/wget.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2008 04:23 AM
тАО06-03-2008 04:23 AM