title: How do I use su to execute the rest of the bash script as that user?
body: <p>I've written a script that takes, as an argument, a string that is a concatenation of a username and a project. The script is supposed to switch (su) to the username, cd to a specific directory based upon the project string.</p>
  
  <p>I basically want to do:</p>
  
  <pre><code>su $USERNAME;  
  cd /home/$USERNAME/$PROJECT;  
  svn update;  
  </code></pre>
  
  <p>The problem is that once I do an su... it just waits there. Which makes sense since the flow of execution has passed to switching to the user. Once I exit, then the rest of the things execute but it doesn't work as desired.</p>
  
  <p>I prepended su to the svn command but the command failed (i.e. it didn't update svn in the directory desired).</p>
  
  <p>How do I write a script that allows the user to switch user and invoke svn (among other things)?</p>