Open Lartza opened 5 years ago
bash ServerStart.sh fails on cd because it tries to cd to the filename
ServerStart.sh: line 143: cd: ServerStart.sh: Not a directory
Safest fix would seem to be to use cd "$(dirname "$(readlink -f "$0" || realpath "$0")")" || exit instead, from https://stackoverflow.com/a/17744637
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")" || exit
Safest fix would seem to be to use cd "$(dirname "$(readlink -f "$0" || realpath "$0")")" || exit
This works. Can confirm on Debian 9.
Run as sh ./ServerStart.sh This is a shell script, not a bash script.
sh ./ServerStart.sh
@matthew-williams https://github.com/AllTheMods/Server-Scripts/blob/master/ServerStart.sh#L1
bash ServerStart.sh fails on cd because it tries to cd to the filename
Safest fix would seem to be to use
cd "$(dirname "$(readlink -f "$0" || realpath "$0")")" || exit
instead, from https://stackoverflow.com/a/17744637