title: Ubuntu bash - unexpected end of file error
body: <p>I'm trying to learn a bit about bash-commands -- more specifically about backup-scripts.
  Unfortunately, I get a syntax error on the last line. I have no idea what I've done wrong and would appreciate any feedback on this matter.</p>
  
  <p>Code:</p>
  
  <pre><code>#!/bin/sh
  
  if [ -f $"/archive/backup-20110111.tar.gz" ]; then
      echo "File already exists"
  else
      sudo cp /home/plepple/Documents/backup/backup-20110111.tar.gz
              /home/plepple/Documents/backup/archive/backup-20110111.tar.gz
      rm /home/plepple/Documents/backup/backup-20110111.tar.gz
  fi
  
  if [ -f $"/archive/backup-20110112.tar.gz" ]; then
      echo "File already exists"
  else
      sudo cp /home/plepple/Documents/backup/backup-20110112.tar.gz
              /home/plepple/Documents/backup/archive/backup-20110112.tar.gz
      rm /home/plepple/Documents/backup/backup-20110112.tar.gz
  fi
  
  curdate='date +%Y%m%d'
  mv /home/plepple/Documents/backup/backup.tar.gz
     /home/plepple/Documents/backup/backup-$curdate.tar.gz
  </code></pre>
  
  <p>I tried to execute it (through bash) with:</p>
  
  <pre><code>bash backupscript.sh
  </code></pre>
  
  <p>All the files and directories exist.</p>
  
  <p>Thanks!</p>