ftp question???


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ftp question???
# 1  
Old 09-18-2006
ftp question???

Hi

Look at the below:

ftp -i novellftp
user $LOGIN
pass $PASSWORD
bin
cd //stecnv16/data/shared/public2/gui/webhelp
mget help.zip
bye
unzip help.zip
rm help.zip
mv help WebHelp
exit;;

know i want to write the above commands in script. but when my first command execute it is asking LOGIN and Passowrd, it was not taking though i have defined in variables, can someone look at tell me waht was the wrong i am doing...

when i execute the above i get the below

Connected to stecnv08.bjuhealth.com.
220 Service Ready for new User
Name (novellftp:g_gkc):

what way i can write the script so that, i can go with out entering my userid and password

Last edited by gkrishnag; 09-18-2006 at 07:49 AM..
# 2  
Old 09-18-2006
use here document

Code:
ftp -ivn << !
open $1 
user $2 $3 
close
bye
!

check these links

this
this
# 3  
Old 09-18-2006
Not working???

#!/bin/sh
#
USERNAME=.gg900079.irock.symbosis
PASSWORD=hello!23
ftp -i novellftp << EOF
user $USERNAME $PASSWORD
bin
cd //stecnv16/data/shared/public2/gui/webhelp
mget help.zip
bye
EOF

when i run the abo/home/cvs ->ftp.sh
Password:Name (novellftp:g_gopala):
Login Failed for User user
Login failed.
Cmd Failed - Login using User and Pass
Cmd Failed - Login using User and Pass
Cmd Failed - Login using User and Pass
can't find list of remote files: No such file or directoryve i get the below error:

can you please correct the below...
# 4  
Old 09-18-2006
Quote:
ftp -i novellftp
user $LOGIN
pass $PASSWORD
bin
cd //stecnv16/data/shared/public2/gui/webhelp
mget help.zip
bye
change this to
ftp ftp://$user:$pass@$host/path_to_file
where user, pass and host -- your variables
# 5  
Old 09-18-2006
Hi

i have the ftp as

/home/cvs ->nslookup novellftp
Using /etc/hosts on: gort

looking up FILES
Trying DNS
Name: stecnv08.gamesbsi.com
Address: 192.18.15.17
Aliases: novellftp.gamesbsi.com

how can i put the above, i am trying as below and that is throwing error!!!

ftp ftp://.gg900079.gamesbsi.tech:hello!23@novellftp.gamesbsi.com //stecnv16/data/shared/public2/gui/webhelp

i am getting the error as below
usage: ftp host-name [port] .. can you please correct me
# 6  
Old 09-18-2006
Ok.
Which OS do you use?

(command syntax may be different in several OSes. My example was to FreeBSD)
# 7  
Old 09-18-2006
Hi

we use solaris
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ftp question

I have this FTP script: ADDR=168.218.95.172 ftp -inv $ADDR <<- ftpcmds user HEHCFTP H$h673sp ... (3 Replies)
Discussion started by: lena keung
3 Replies

2. Shell Programming and Scripting

FTP question

HI In my script its like this ------------ echo "Enter filename" read fname ftp -v -n abcd.efh.kk.com << EOF user userid pwd bin mget $fname.tar--not working if i give "$fname", works only as "demo.tar" bye ------------ My target is to get a $fname.tar from a remote host.How... (4 Replies)
Discussion started by: coolkid
4 Replies

3. Shell Programming and Scripting

ftp question

Hi, i have a simple question here-- if we dont use binary while doing a ftp of a file,any sort of problem can arise from this or it is ok. Thanks (2 Replies)
Discussion started by: namishtiwari
2 Replies

4. UNIX for Dummies Questions & Answers

Question on FTP

Hi All, I'm new to this group and this is my first post to this group. I need to write a shell script for the requirement given below: 1. I need to connect to a ftp server with my username and password 2. I need to go to some(input) directory. 3. I will have files with same names and... (1 Reply)
Discussion started by: ranjith_taurean
1 Replies

5. UNIX for Dummies Questions & Answers

FTP Question

How do you limit an ftp user access to a certain Unix path when putting/getting file to/from your server? And how do you restrict the ftp user from using "cd" or "ls" commands? Given that the ftp user knows the ftp userid, password, and your server ip address. Thanks in advanced :) (1 Reply)
Discussion started by: XZOR
1 Replies

6. UNIX for Dummies Questions & Answers

FTP Question

I'm basically trying to FTP a file to a differnt node, first putting the FTP commmands into a text file and then piping the commands file into the ftp command as follows.... echo "user $USERNAME $PASSWORD" > ftp_cmds echo "put $SQLOUT /users/$USERNAME/$SQLOUT" >> ftp_cmds echo "quit" >>... (4 Replies)
Discussion started by: djkane
4 Replies

7. UNIX for Advanced & Expert Users

FTP Question

Once a file is ftped to a server is there a way that you can prevent that file from being overwritten if the same process tries to ftp a file with the same name again? (6 Replies)
Discussion started by: lesstjm
6 Replies

8. UNIX for Dummies Questions & Answers

FTP Question

When a user FTP's to their own directory, they can go up the directory and view others files, of course they can not overwrite them but are able to download them if they wish to, is there any way to stop them from view their files and have them be only able to view files that they have permissions... (3 Replies)
Discussion started by: foresthillian
3 Replies

9. UNIX for Advanced & Expert Users

FTP Question

Hi, I'm attempting to FTP several files using MGET. My problem is that I need to cd to a directory with this naming convention: YYMMDDHHMM - where the hour and minute is unknown When I issue cd /ftpdirectory/YYMMDD* from FTP, I receive "No such file or directory I need a way to get the... (6 Replies)
Discussion started by: kdreaves
6 Replies

10. UNIX for Dummies Questions & Answers

FTP Question

I am really new to unix and want to setup an ftp server on my PC I am running a Ultra 5 with solaris 9 on it. I cannot seem to find *any* documentation on how to do this. So I was hoping somebody could point me in the right direction. :confused: (3 Replies)
Discussion started by: ls=dir
3 Replies
Login or Register to Ask a Question