RE: ftp script

RE: ftp script

 

  

Try using this:

#!/sbin/sh
cd [foldername]
read [varname]
ftp -v [servername] $varname <<END_SCRIPT
USER [username]
PASS [password]
binary
cd [foldername]
put [filename]
quit
END_SCRIPT

The values in brackets are to be replaced with your own values. Remove the brackets. I have used this script for sending the file over non interactively. For your purpose I have added the first two lines as you wanted it to ask for the file name and I am trying to send the entered variable name in ftp program by passing it as an argument to ftp command. I am not sure if it would work fool-proof but you can try it. Hope it helps.

Gurmohan
www.onlymath.com

---------------------------------------------------------------------------------------------------

-----Original Message-----
From: Inder Singh
[mailto:oracledba-ezmlmshield-x22143053.[Email address protected]
Sent: Wednesday, May 25, 2005 1:59 PM
To: LazyDBA Discussion
Subject: ftp script


All,

Does anybody has a ftp script which ftp's file from unix to pc? Is it
possible that I can pass parameter in that script. What I am looking for is
when I run the ftp script it should ask for a file name which is concurrent
output file and then transfer the file from unix to local PC.

Regards,
Inder


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:http://www.lazydba.com/legal.html

Oracle LazyDBA home page