If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > FTP Script Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-03, 12:29
lux35 lux35 is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
FTP Script Error

Help! please.

I have a script named ftpput to which i pass the following arguments:

ip - server ip
user - username
pass - password
$1 - name of the file


ftp -n << EOF
verbose
open ip
user user pass
ascii
lcd /domino/notesdata50/prod/cantina_files
put $1
bye
EOF

echo "FTP Terminado"


when i execute the script it gives an error: File Not Found

But the file is there, in the directory.

What am i doing wrong?
Reply With Quote
  #2 (permalink)  
Old 12-14-03, 17:18
fla5do fla5do is offline
Registered User
 
Join Date: Oct 2003
Location: Germany
Posts: 138
Hello lux35.

my first tip is : donīt use $1 for the filename.
Use File="name of the file"

In ftp commands use -put $File-

second tip is : try your commans step by step in comandline by using "ftp"
__________________
Greetings from germany
Peter F.

Last edited by fla5do; 12-14-03 at 17:24.
Reply With Quote
  #3 (permalink)  
Old 12-16-03, 21:53
mhz mhz is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
he can use $1 if, he runs his program like this:
./script.sh file.txt

now i haven't done scripting in a few months, but i think it'll work if you do it pretty much the way you had it.

ip = 56.142.565.451
user = "johnny"
pass = "passwd"

ftp -n << EOF
verbose
open $ip
user $user $pass
ascii
lcd /domino/notesdata50/prod/cantina_files
put $1
bye
EOF

echo "FTP Terminado"

then to run it, it'd be ./script.sh yourfile.txt
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On