I have a shell script that runs a bunch of commands (on OS X 10.7) as part of a build step for XCode. The script removes a bunch of files and copies a bunch of files.
The problem I have right now is that if the cp command fails, the build still 'succeeds' according to XCode, presumably because the script still returns with an exit status of 0. How can I capture the result of the cp ? I looked up the man page and it doesn't seem to return a value.