#!/bin/bash # figure out the absolute path to the script being run a bit # non-obvious, the ${0%/*} pulls the path out of $0, cd's into the # specified directory, then uses $PWD to figure out where that # directory lives - and all this in a subshell, so we don't affect # $PWD GAMEROOT=$(cd "${0%/*}" && echo $PWD) #determine platform UNAME=`uname` if [ "$UNAME" == "Darwin" ]; then # prepend our lib path to LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=${GAMEROOT}:$DYLD_LIBRARY_PATH elif [ "$UNAME" == "Linux" ]; then # prepend our lib path to LD_LIBRARY_PATH export LD_LIBRARY_PATH=${GAMEROOT}:$LD_LIBRARY_PATH fi if [ -z $GAMEEXE ]; then if [ "$UNAME" == "Darwin" ]; then GAMEEXE=hl_osx elif [ "$UNAME" == "Linux" ]; then GAMEEXE=hl_linux fi fi ulimit -n 2048 # and launch the game cd "$GAMEROOT" STATUS=42 while [ $STATUS -eq 42 ]; do ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} -game dod $@ STATUS=$? done exit $STATUS Error text at startup:
/root/dod.sh: 13: [: Linux: unexpected operator /root/dod.sh: 16: [: Linux: unexpected operator /root/dod.sh: 22: [: Linux: unexpected operator /root/dod.sh: 24: [: Linux: unexpected operator /root/dod.sh: 36: /root/dod.sh: /root/: Permission denied The script just does not start. I want to know how to fix this error. I downloaded the toy, dropped it into the folder and run the script. He swears. In Google, I could not find a solution to the error. In this case I am a layman, for this I ask for help. When you run #. / Dod.sh nothing happens When you run #bash ./dod.sh too.
root@GeenTeen:~$ cat -n dod.sh | grep 16 | hd 00000000 20 20 20 20 31 36 09 65 6c 69 66 20 5b 20 22 24 | 16.elif [ "$| 00000010 55 4e 41 4d 45 22 20 3d 3d 20 22 4c 69 6e 75 78 |UNAME" == "Linux| 00000020 22 20 5d 3b 20 74 68 65 6e 0a |" ]; then.| 0000002a
cat -n dod.sh ...). The fact is that I haveLinux avp-ubu1 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/LinuxinLinux avp-ubu1 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linuxthis script works , of course, ending with the message./tt.sh: line 36: /home/avp/hashcode/hl_linux: No such file or directory. Try inserting the following code into the line after#!/bin/bash[ A == A ] && echo It works! && exit[ A == A ] && echo It works! && exitand write what happened - avp