title: 'bash: syntax error near unexpected token `do
body: <p>I created the bash script below to replace the SVN URL for working copies.</p>
  
  <p>I can confirm this <strong>works perfectly on my Linux system</strong> however it <strong>does NOT work on my Mac OS system</strong>. I'll be able to provide the error I get back later but wondered if someone could point me in the right direction. I believe it is to do with the space in the WORKING_DIR variable, I have tried many variations found on Google including escaping the space \ adding " and ' but still no luck.</p>
  
  <pre><code>#!/bin/bash
  filepath=$(pwd)
  URL=https://192.168.22.225/svn
  WORKING_DIR="/Users/user/Documents/Working Copies"
  cd "${WORKING_DIR}"
  for f in "${WORKING_DIR}"/*
  do
          if [[ -d $f ]]; then
          (
          cd "${f##*/}"
          #printf "\n$PWD\n${URL}/${f##*/}\n"
          svn relocate "${URL}"/"${f##*/}"
          )
          fi
  done
  cd "$filepath"
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>: No such file or directoryments/Working Copies
  'bash: working.sh: line 7: syntax error near unexpected token `do
  'bash: working.sh: line 7: `do
  </code></pre>