title: syntax error near unexpected token `}' `
body: <p>I'm writing a shell script to make a new save file for the game risk of rain. I'm trying to make it so that each section of the unlocks that are available, such as achievements, monster logs, artifacts, etc. can either be added all at once to the file, or the user will be able to pick which ones they want added. I am new to writing shell scripts and I am not quite sure why I am getting the error <strong><em>syntax error near unexpected token `}'</em></strong> when I run what I have so far of my script. If anyone could explain to me as to why I am getting the error, how to fix it, and/or how to improve my script, it would be greatly appreciated. Also I am on Mac OS X if that matters. Here is my script.</p>
  
  <pre><code>#!/bin/bash
  mkdir ~/Desktop/ror_save_unlock_all
  
  echo "This script takes ~/Library/Application Support/com.riskofrain.riskofrain/Save.ini and backs it up to ~/Desktop/ror_save_unlock_all/originalSave. It generates a new Save.ini that is built to your specifications, unlocking all items and achievements or just the ones you choose, and replaces the existing Save.ini with the new one." &gt;&gt; ~/Desktop/ror_save_unlock_all/README.txt
  
  mkdir ~/Desktop/ror_save_unlock_all/originalSave
  
  cp ~/Library/Application\ Support/com.riskofrain.riskofrain/Save.ini ~/Desktop/ror_save_unlock_all/originalSave/
  
  cd ~/Desktop/ror_save_unlock_all
  
  echo -n 'How would you like the new Save.ini to be built? Press 1 for all unlocks or 2 to customize.'
  read text
  if [ $text = "1" ]
  then 
      {
          echo "[Achievement]" &gt;&gt; EOF1
  
          count=1
  
          while [ $count -lt 55 ]
          do
            echo "acheivement${count}=\"2\"" &gt;&gt; EOF2
            count=`expr $count + 1`
          done
  
          echo "[Record]" &gt;&gt; EOF3
  
          count=1
  
          while [ $count -lt 31 ]
          do
            echo "mons${count}=\"1\"" &gt;&gt; EOF4
            count=`expr $count + 1`
          done
  
          count=1
  
          while [ $count -lt 110 ]
          do
            echo "item${count}=\"1\"" &gt;&gt; EOF5
            count=`expr $count + 1`
          done
  
          count=1
  
          while [ $count -lt 10 ]
          do
            echo "artifact${count}=\"1\"" &gt;&gt; EOF6
            count=`expr $count + 1`
          done
  
          cat EOF1 EOF2 EOF3 EOF4 EOF5 EOF6 &gt; Save.ini 
  
          rm EOF1 EOF2 EOF3 EOF4 EOF5 EOF6 
  
          cp -force ~/Desktop/ror_save_unlock_all/Save.ini ~/Library/Application\ Support/com.riskofrain.riskofrain/Save.ini
  
          echo "Original Save.ini successfully overwritten."
  
          exit
  
      }   
  
  elif [ $text = "2" ]; then
      {
          echo "You selected customize. Now we will build a custom Save.ini"
          echo -n "Press 1 if you want to unlock all achievements, press 2 to continue without unlocking all achievements."
          read text
          if [ $text = "1" ]; then 
  
              {
                  echo "[Achievement]" &gt;&gt; EOF1
                  count=1
                  while [ $count -lt 55 ]
                  do
                    echo "acheivement${count}=\"2\"" &gt;&gt; EOF2
                    count=`expr $count + 1`
                  done
  
                  echo "All achievements successfully unlocked."
                  echo -n "Press 1 to make the Save.ini and replace the existing one with it and then exit, or press 2 to customize it further."
                  read text
                  if [ $text = "1" ]; then
                      {
                          cat EOF1 EOF2 &gt; Save.ini
                          rm EOF1 EOF2
                          cp -force ~/Desktop/ror_save_unlock_all/Save.ini ~/Library/Application\ Support/com.riskofrain.riskofrain/Save.ini
                          echo "Original Save.ini successfully overwritten."
                          exit
                      }
  
                  elif [ $text = "2" ] then;
                      {
                          echo -n "Press 1 to unlock all monster logs, or press 2 to continue without unlocking all monster logs."
                          read text
                          if [ $text = "1" ]; then
                              {
                                  echo "[Record]" &gt;&gt; EOF3 
  
                                  count=1
                                  while [ $count -lt 31 ]
                                  do
                                    echo "mons${count}=\"1\"" &gt;&gt; EOF4
                                    count=`expr $count + 1`
                                  done
  
                                  echo "All achievements successfully unlocked."
                                  echo -n "Press 1 to make the Save.ini and replace the existing one with it and then exit, or press 2 to customize it further."
                                  read text
                              }
                          }
                      }
                  }
  </code></pre>