file transfer using Ftp

Hi All,

I am very new to shell scripting,I have some doubts how we can do a file transfer using ftp

I wanted to transfer files using non_secure ftp and secure ftp(sftp) mode,
for secure ftp i am using following code

verbose="verbose" 
ftp="/usr/bin/ftp" 
user="ABC"
pass="123"
IP="XXX.XXX.4.190" 
echo "open $IP 
      quote USER $user 
      quote PASS $pass 
      $verbose 
      $type 
      put $inputfilepath  $outputfilepath 
      close 
      quit" |$ftp -n

All variables are hard coded in th begining,How do i can find out IP addrss,username,password and assign those to below mentioned variables $IP ,$user ,$pass dynamically by creting a temp file contains all these information

and how i can perform non-secure FTP Please help me

Thanks in advance

your "tmpfile" that contains the server/userdata

user="ABC"
pass="123"
IP="XXX.XXX.4.190" 

your ftp-script,
call it like this:
ftpscript /path/to/the/userdata-tmpfile

$1
verbose="verbose" 
ftp="/usr/bin/ftp" 
echo "open $IP 
      quote USER $user 
      quote PASS $pass 
      $verbose 
      $type 
      put $inputfilepath  $outputfilepath 
      close 
      quit" |$ftp -n

should work