The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-10-2009
OrlandoRost OrlandoRost is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 3
FTP. Autoconnection

Hello, all!

How can I use ftp commands for autoconnection to ftp-server from from UNIX script?
Shell is sh.
I have login and pass (I should connect not as anonymous).
By this time I have tried the next (Server-name is ftp:\\serv.com, user is 'user' and pass is 'pass').

1. ftp -P serv.com user pass
answer is: '-P unknown option.'
But I got it from man ftp.
Strange...

2. ftp serv.com user pass
anser is: 'usage: ftp host-name [port]'.
and etc...

I'm not advanced in UNIX, so, sorry for stupid questions
Please, feel free to ask me if need

Thx. a lot!
  #2 (permalink)  
Old 01-10-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
start with a here document - this example uses EOF as the boundary delimiter fro the here document.
Code:
filetosend="myfile"
ftp -n  <<EOF
open serv.com
user myusername mypassword
put $filetosend
bye
EOF
  #3 (permalink)  
Old 01-10-2009
OrlandoRost OrlandoRost is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 3
Still the same result is: 'usage: ftp host-name [port]'
Code I used is bellow:

ftp -n <<EOF
open ftpserver.com
user myuser mypass
EOF

I just wanted to connect to the server without file transfer...
Is 'put file to ftp' important action in this situation?

Many thx., Jim!
  #4 (permalink)  
Old 01-10-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
There are only a few things you can do with an ftp connection- what do you want to do with your ftp?
  #5 (permalink)  
Old 01-11-2009
OrlandoRost OrlandoRost is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 3
Yes, I need to transfer file to server in farther.
But now I just trying to create connection from command line by one command string.
If I do it then I will create a script with file transferring.
The problem is not in file transfering but in autoconnection.
In interaction mode I login to server and transfer files successfully and now I just want to automatize it.
That's all.

Many thx!
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0