View Single Post

   
  #10 (permalink)  
Old 04-24-2008, 04:43 PM
bcohen@example.com
 
Posts: n/a
Default Re: Scripted FTP transfer

In article <fukbc8$mej$1$8300dec7@news.demon.co.uk>, Julian Brett wrote:
> Hi all.
>
> I'm attempting to script an FTP transfer on my UnixWare 7.1.4 server. I've
> written numerous FTP transfer scripts before, but haven't really approached
> it this way.




This sort of thing in a script file has always worked for me
under various unixen:



cd_dir="somedir"
file="somefile.txt"
user="myusername"
host="myhost.com"
echo -n "Password for ${user} at ${host}: "
read pass

echo "
open ${host}
user ${user} ${pass}
#passive
bin
hash
prompt
cd ${cd_dir}
pwd
ls
chmod 700 *
mdele *
put ${file}
chmod 000 *
ls
" | ftp -n

Reply With Quote