on unix, ftp to windows...logging in


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers on unix, ftp to windows...logging in
# 1  
Old 10-15-2007
on unix, ftp to windows...logging in

I am ftp'ing to one of our network drives to pick up a tar file. In the script, it does the ftp, but doesn't pick up the username and password. Do I need to script these a certain way so it knows this is input?

ftp machinename.com
userid
passwd
# 2  
Old 10-15-2007
Use -inv option

Example

FTP_SERVER is the source server
FTP_USER ftp userid
FTP_PSWD is passowrd
FTP_LOG is log file to capture results from the ftp

ftp -inv ${FTP_SERVER} << EOF_FTP >> ${FTP_LOG}
user ${FTP_USER} ${FTP_PSWD}
cd ${FTP_DIR}
mget ${FTP_FILE}
quit
EOF_FTP
vshar
# 3  
Old 10-15-2007
Thank you. I was looking at the -n option with QUOTE. I'll try this.
# 4  
Old 10-17-2007
I am working with korn shell and when I put the actual commands into a function, I get an error:
Syntax error at line 43 : `<' is not matched.

Is this due to the '{' characters? I tried putting " in place around the variables but got the same error.

What needs to be changed?
# 5  
Old 10-18-2007
Is there any space after '<' character ?

Something like,

Code:
ftp<< EOF
EOF

where EOF should be without any preceding space(s)

should be something like

Code:
ftp<<EOF
EOF

Could you please check that ?
# 6  
Old 10-18-2007
Thank you very much.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP from windows to unix server using unix shell script

Hi, Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting? If so what command i need to use. thanks in advance. (1 Reply)
Discussion started by: Shri123
1 Replies

2. Shell Programming and Scripting

UNIX script to FTP file from UNIX server to windows

Hi, I am new to this subject.....Can someone please help me out with the script... unix usernm "sdhftst" unix pwd "chsd13" windows usernm "dfghtst" windows pwd "chsd13" path..../xxx/xxxxx/xxxxxx/xxxxxxx please can u get me a script...its only one file to get ftp. Thanks... (2 Replies)
Discussion started by: himakiran9
2 Replies

3. AIX

Do I need to configure my local windows to FTP files from local windows to a UNIX AIX server?

Hi Friends, I have this script for ftping files from AIX server to local windows xp. #!/bin/sh HOST='localsystem.net' USER='myid_onlocal' PASSWD='mypwd_onlocal' FILE='file.txt' ##This is a file on server(AIX) ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies

4. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

5. UNIX for Dummies Questions & Answers

Windows to UNIX FTP

Good Morning, I am currently having a setup of running a batch file in windows to ftp certain files to unix and after that one i login to a unix box to manually run a script to clean up those files and combine them into one and get go back to windows to run another batch of file to get the... (4 Replies)
Discussion started by: ryan_estiya
4 Replies

6. Shell Programming and Scripting

FTP from windows to unix

I am trying to run this script to ftp something from windows and am getting the following error when trying to view the directories.. Connected to 192.168.1.22. 220-Microsoft FTP Service 220 LOGS ftp> ls -lrt 530 Please login with USER and PASS. 530 Please login with USER and PASS. This is... (1 Reply)
Discussion started by: dowell
1 Replies

7. UNIX for Dummies Questions & Answers

FTP from unix to Windows

Hi, I know that there should be a FTP server in Windows or a FTP listener daemon running in windows. Iam a beginner. May I know, what setup need to be done on Windows/unix end so that, a file can be transferred using sftp/scp from unix to windows. Thanks in Advance. (2 Replies)
Discussion started by: deepakwins
2 Replies

8. UNIX for Dummies Questions & Answers

FTP from windows to unix

Hi all, How to FTP an excel format file located in windows to unix using shell script.Any particular commands we have to use? Thanks& Regards, rrs (4 Replies)
Discussion started by: rrs
4 Replies

9. UNIX for Dummies Questions & Answers

FTP from Unix to Windows: Need help!

Hello everyone, I know nothing about Unix, however, I developed a Windows VB app that takes ascii flat files and generates formatted excel reports in single or batch mode. There are about 200 reports that come off the mainframe from a unix box which I have to manually download into my Windows... (3 Replies)
Discussion started by: eguy
3 Replies

10. UNIX for Dummies Questions & Answers

ftp from unix to windows

Hi, I have been using ftp to transfer files back and forth between windows and unix machines. But everytime i started the ftp session from the windows machine. I have a question why I am not able to connect to the same windows machine from the same unix machine. How do I do this? ... (11 Replies)
Discussion started by: oldtrash
11 Replies
Login or Register to Ask a Question