The specific error you're getting is because of the way you are trying to execute the script (and the rather strange way the script is written).
When a script is run, positional parameter 0
contains the name by which the script was invoked, e.g. path/to/start.sh
- or simply ./start.sh
if it is called from the current directory. The parameter expansion syntax ${0%/*}
removes the shortest suffix from $0
matching /*
leaving (respectively) path/to
or just .
and the script then attempts to change to this directory - in other words, to the parent directory of start.sh
However, when you use sh start.sh
(as well as executing the script using sh
instead of the intended /bin/bash
), $0
equals start.sh
. Since there's no matching /
, ${0%/*}
doesn't remove anything from $0
, resulting in the script trying to execute the command cd start.sh
which obviously fails because start.sh
is a file not a directory.
The solution is to execute the script the way the author presumably intended - that is, by ensuring it is executable
chmod +x start.sh
and then executing it directly, e.g.
./start.sh
I'm now getting libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast
– janat08 Jun 09 '16 at 02:36