Calling an app from the terminal via script
That looks like /Applications/MyApp.app doesn't actually exist. 

You can test for that in your script, perhaps like this:

#!/bin/sh
APP=/Applications/MyApp.app
if [ ! -d "$APP" ]; then
  echo &gt;&amp;2 "$0: $APP not found."
  exit 1
fi
exec open -a "$APP" "$@"