- edited description
[Regression] Shellscript for Linux start (eternity.sh) fails in directories with spaces
The new shell script for starting the program on Linux fails when run from a directory that has spaces in its name. The reason are the missing quotes when setting the variable ROOT:
ROOT=$(dirname $(readlink -f $0))
If we break it down, readlink will return something like:
/home/user/GOG Games/Pillars of Eternity/EternityKeeper/eternity.sh
(which is the default installation path for the GOG version, so probably quite common).
Then dirname will break these apart into this:
$ dirname /home/user/GOG Games/Pillars of Eternity/EternityKeeper/eternity.sh
/home/user
Games
.
Eternity/EternityKeeper
Which will cause everything else that depends on ROOT being set correctly to fail.
The fix is to enclose the directory name in double quotes:
$ dirname "/home/user/GOG Games/Pillars of Eternity/EternityKeeper/eternity.sh"
/home/user/GOG Games/Pillars of Eternity/EternityKeeper
I therefore propose to change the third line of eternity.sh to this:
ROOT=$(dirname "$(readlink -f $0)")
That should fix the problem.
Comments (4)
-
reporter -
repo owner - changed status to resolved
-
repo owner Fix
#12: run from path with spaces→ <<cset e80246563cdb>>
-
repo owner Merged in valery1707/eternity-keeper/valery1707/fix-12-run-from-path-with-spaces-1499677407482 (pull request #2)
Fix
#12: run from path with spaces→ <<cset ca8901abe891>>
- Log in to comment