Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send file in a batch file 2

Status
Not open for further replies.

specv

Programmer
Aug 8, 2001
42
CA
Hi all,
I want to send with ftp in a unix batch file. I try some combinaison but look like impossible.

ftp serverName
username
password
put test test2
close
quit

Can you help me with this code?

Thanks,
Phil
 
ftp <<EOF
open serverName
user username password
put test test2
quit
EOF

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Hi vlad,
I try your code. When I start the script look like to want my password :

dcegdmd@sda2 ==> script.sh
Password: Name (serverName:dcegdmd):

I try to type my password and press enter and I have this message :

Login incorrect.
Login failed.
Please login with USER and PASS.
Please login with USER and PASS.
dcegdmd@sda2 ==>

Do you have an idea?
Thanks,
Phil
 
You have to set your 'serverName', 'username', 'password' shell variable first. Then supply the values of the variables in the script

#------------------------
serverName=myServerIP
username='myUserName'
password='myUserPassword'

ftp <<EOF
open ${serverName}
user ${username} ${password}
put test test2
quit
EOF

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
ooops - missed that one.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks Vlad and Ygor with the -n all is ok!
Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top