title: Running shell script with NSTask causes posix_spawn error
body: <p>I'm trying to run a shell script with NSTask with the following code:</p>
  
  <pre><code>NSTask *task = [[NSTask alloc] init];
  [task setLaunchPath:@"/Users/username/connect.sh"];
  [task launch];
  </code></pre>
  
  <p>But I get <code>An uncaught exception was raised</code> and <code>Couldn't posix_spawn: error 8</code></p>
  
  <p>If I just run the script in terminal, everything works.</p>
  
  <p>Here is what the script contains:</p>
  
  <pre><code>if [ ! -d ~/Remote/username/projects  ] 
  then  
          sshfs -C -p 22 user@remotecomputer.com:/home/username ~/Remote/username        
  fi
  </code></pre>