title: EOT in conditional section of bash script
body: <p>So, i'm trying to get an ftp script working but i'm hitting a snag. Here's the script:</p>
  
  <pre><code>#!/bin/bash
  HOST='192.168.178.122'
  USER='ftpuser'
  PASSWD='passa.2015'
  DATE=`date +%d-%m-%Y`
  FILE="archive-"$DATE".tar.gz"
  
  prep=0
  echo "File is="$FILE
  echo "Prepare_val="$prep
  if [ $prep -eq 0 ]
      then
          find Web -maxdepth 1 -mindepth 1 -not -type l -print0 | tar --null --files-from - -cpzvf $FILE
  
          ftp -n $HOST &lt;&lt; EOT
          user $USER $PASSWD
          put $FILE
          quit
          bye
          EOT
  fi
  </code></pre>
  
  <p>When i try and run this script, it returns the following error:</p>
  
  <pre><code>ftp-script.sh: 22: ftp-script.sh: Syntax error: end of file unexpected (expecting "fi")
  </code></pre>
  
  <p>If i remove the EOT section, it executes fine, but the EOT is the only means by which the ftp commands can be run without needing user intervention. Does anyone know how to place an EOT in a conditional without causing the error I get.</p>