The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-08-2006
alfredo123 alfredo123 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 44
FTP script debugging

Hello all,

I am trying to run a script and have not had much success running it...ne help debugging it will be appreciated..The ftp script alone works but not within the while loop.

below is the script


Code:
#!/usr/bin/ksh
destination_server=servename
destination_user_id=un
destination_password=pw

myfile=/dir1/xxx.dat
while true
 do
  if [[ -a $myfile ]]; then
    echo "$myfile exists!"
    ftp -v -n $destination_server <<END
     user $destination_user_id $destination_password
     cd dir3
     put $myfile
    END
    
    echo 'FTP Complete'
  else
    sleep 600
  fi
done

I am getting the error

0403-057 Syntax error at line 12 : `<' is not matched.