ftp from unix to windows - urgent help required


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ftp from unix to windows - urgent help required
# 1  
Old 09-04-2007
ftp from unix to windows - urgent help required

I'm trying to ftp from a Unix machine to a Windows machine..

I've tried the following

#!/bin/sh
#set -x
USER="user1"
PASS="pass1"
HOSTNAME="host1"

ftp -n -i -v $HOSTNAME << EOT
user $USER $PASS
cd /
send text1.txt
close
bye
EOT

When I try to run this, I get prompted for the password. But since this will be working in a Production environment and run by people who have no idea what this script will be doing , the process should be automated. The user id and password have to go in automatically and the file should be put in.

I've tired different options like
ftp -n -i -v << EOT
open $HOSTNAME
$USER
$PASS
cd /
send text1.txt
close

as well as
ftp -n << EOT
open $HOSTNAME
quote USER $USER
quote PASS $PASS
cd /
send text1.txt
close

but always I keep getting the same error, where I'm prompted for the password.

Output when running script
----------------------------------
****
Connected to host1
220 FTP server (Hummingbird Ltd. (HCLFTPD) Version 9.0.0.0) ready.
331 Password required for user1
***

This is kind of urgent. Any help would be greatly appreciated.

Thanks
Sam
# 2  
Old 09-04-2007
Have you tried using "$HOME/.netrc" to store the username/password?
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. Shell Programming and Scripting

ftp from unix to windows

How to do ftp from unix to windows i have some files in a dir in unix box and i want to put those files in windows through FTP. How to do this ? (9 Replies)
Discussion started by: ali560045
9 Replies

6. 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

7. 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

8. HP-UX

URGENT: UNIX FTP cannot find path error

Dear all We are currently working on to install some ERP system in wjhich we need to FTP from unix to windows 2000 machine We run ./lodrun to get files from d/xxxxx/xxxx directory but the ftpoutput.log file shows following error FTP: xxxxxxxxx system cannot find the path specified... (1 Reply)
Discussion started by: minix
1 Replies

9. Windows & DOS: Issues & Discussions

Urgent Need for Assistance: Triggering Windows bat files from UNIX

Hello, Is there a way to trigger a Windows bat file or program on a different machine from a different UNIX server using KSC file? I hope you can assist me with this. Thanks! (0 Replies)
Discussion started by: punyenye
0 Replies

10. UNIX for Dummies Questions & Answers

UNIX linked to Windows Urgent

hey guys! I know this one is simple since you are the gurus. To make a long story short can i install an oracle database on a unix server and link to that server with a asystem that was written in Visual Basic 6? Please help (1 Reply)
Discussion started by: akrum
1 Replies
Login or Register to Ask a Question