Wrong working directory, if bash script is opened via double-click
If your script is stored at ~/workspaces/myproject/launch.sh and you want to be in that directory when you run, change to that directory, you can get the directory where the script is saved with this one liner:

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" &amp;&amp; pwd )


So the first few lines of your script become:

#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" &amp;&amp; pwd )
cd "${DIR}"
...the rest of your script...


This will put you in the directory where the script is stored no matter how your run the script.

If you want to learn more about detecting the location on disk of a script at execute time see this excellent StackOverflow answer.