title: Syntax error: "(" unexpected (expecting "then")
body: <p>I am having troubles with a bash script. I am trying to automate the process of sending files to my raspberry pi through ssh. I want to prompt for a path to a file/directory, then copy it to the <code>/home/pi/push</code> directory on my pi. I then want to ask if there is another file to send, and if yes then loop back again, otherwise exit the program. I zeroed out the IP address for obvious security reasons.</p>
  
  <pre><code>done=0
  while [ $done -lt 1 ]
  do
      read -r -p "Path to file: " path
      spawn scp -r $path pi@000.00.000.00:/home/pi/push
      expect "assword:"
      send "password\r"
      interact
  
      read -r -p "Send another? [y/N] " response
      if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
      then
          $done=1
      else
          echo "Ending file transfer."
      fi
  done
  </code></pre>
  
  <p>If you have suggestions on a better way to achieve this, that would be great as well!</p>