title: Lipo working from terminal, but permission denied from bash script
body: <p>If I run this in a terminal (on OSX Mavericks), it works fine:</p>
  
  <pre><code>lipo -create /Release-iphoneos/libMyNewLibrary.a /Release-iphonesimulator/libMyNewLibrary.a -output /Merged/libMyNewLibrary.a
  </code></pre>
  
  <p>I didn't use sudo when running it in the terminal. If I add the exact same code to a bash script, I get the following error:</p>
  
  <blockquote>
    <p>fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't create temporary output file: /libMyNewLibrary.a.lipo (Permission denied)</p>
  </blockquote>
  
  <p>The rest of the bash script works fine (generating the ios and sim libs using xcodebuild), so I'm not sure why the lipo command fails. The 2 libraries to be merged both exist prior to the lipo call being made afaik (the only post I've seen with this error suggested this may be the cause).</p>
  
  <p>Is there another step that needs to be taken for lipo to work from a bash script?</p>