I was making this bash install script on ubuntu 21.10. I was going to test out the first little bit, but I ran into this error.
/tmp/geany_run_script_GBYCG1.sh: 7: ./install sauerbraten 2020: Permission denied
(program exited with code: 126)
Press return to continue
This is the script so far.
#!/bin/bash
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
function error {
echo -e "\e[91m$1\e[39m"
exit 1
}
wget https://sourceforge.net/projects/sauerbraten/files/sauerbraten/2020_11_29/sauerbraten_2020_12_29_linux.tar.bz2/download
#tar -xf
What is wrong, and how can I fix it?
DIRECTORY=
line is completely bonkers. I can't even understand what you're trying to achieve there. And it has too many quote signs. Quote signs are not like parenthesis - every pair of consecutive quotes are closing one string between them. So for instance, your second quotes are closing the first quotes, they don't start a new pair (like I think that you think they should do). But again, I'm having trouble to follow what you're even trying to do. – aviro Jan 18 '22 at 21:29$(...)
are parsed separately from those outside. So the OP is hoping that $0 reflects the path to the current script. The innermost $(..) prints the "physical" location of the script, and the each of the other two $(..) go up one directory level. – icarus Jan 18 '22 at 21:41./install\ sauerbraten\ 2020
executable – steeldriver Jan 18 '22 at 22:37geany_run_script_GBYCG1.sh
, without realizing it was in/tmp/
... But yeah, if the script shown is./install sauerbraten 2020
, then it's probably just achmod
needed on that. – ilkkachu Jan 18 '22 at 22:58