You are not logged in.
Pages: 1
I'm not sure when this ocurred, but I recently dowloaded the witcher 2. It was simply a shell script that I had to execute, but when I tried it I got this:
[mean_booty@[excluded] Downloads]$ sudo ./gog_the_witcher_2_assassins_of_kings_enhanced_edition_2.2.0.8.sh
[sudo] password for mean_booty:
sudo: ./gog_the_witcher_2_assassins_of_kings_enhanced_edition_2.2.0.8.sh: command not foundIt seems to not know how to execute shell scripts. I tested it with a hello world simple shell script and the same thing happened:
[mean_booty@[excluded] Downloads]$ sudo ./hello_world.sh
sudo: ./hello_world.sh: command not foundI think it may be an issue with my paths because typing
bash hello_world.shworks perfectly.
This is my path output:
[mean_booty@[excluded] ~]$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl: No such file or directoryIs there a way to "reset" my paths or anything? Is there something on there that shouldn't be or vice versa?
Thanks
Last edited by mean_booty (2017-11-04 17:51:33)
MSI B450I Gaming Plus AC | Ryzen 3600X | 32 GB 3200MHz Micron-E | RX 5700XT Pulse
Offline
Why are you running the commands with sudo? I think the problem is the relative paths, which would obviously be different for the root user.
Offline
@circleface
$ cat ./hello_world.sh
#!/usr/bin/bash
echo 'hello world'
$ sudo ./hello_world.sh
hello worldOffline
Thanks loqs, I always thought that wouldn't work, but I guess it does ![]()
Last edited by circleface (2017-11-03 22:41:28)
Offline
I don't think this is a path problem. Please post the output of the following command (in that Downloads directory)
ls -l *.shLast edited by 2ManyDogs (2017-11-04 00:01:47)
Offline
[mean_booty@[excluded] Downloads]$ ls -l *.sh
-rw-r--r-- 1 mean_booty mean_booty 21185760060 Oct 20 16:45 gog_the_witcher_2_assassins_of_kings_enhanced_edition_2.2.0.8.sh
-rw-r--r-- 1 mean_booty mean_booty 81 Nov 3 16:40 hello_world.shI just have those two scripts.
If I try to run any shell script not in sudo, it says "permission denied" so that's why I ran these in sudo.
Wouldn't it be either a paths or permissions problem since bash works on its own, but the execution alias doesn't work?
MSI B450I Gaming Plus AC | Ryzen 3600X | 32 GB 3200MHz Micron-E | RX 5700XT Pulse
Offline
You're trying to execute them, they need execute permissions.
Offline
This command will give execute permission for the user that owns the file to your all your scripts in that folder.
$ chmod u+x *.sh
see here
https://wiki.archlinux.org/index.php/Fi … attributes
Offline
Typing
bash hello_world.shis NOT an equivalent test to
sudo ./hello_world.shThe latter is not *just* running with sudo, it is also executing the script directly versus running the bash program with a script file... how do you possibly expect to execute a non-executable file???
[mean_booty@[excluded] Downloads]$ ls -l *.sh -rw-r--r-- 1 mean_booty mean_booty 21185760060 Oct 20 16:45 gog_the_witcher_2_assassins_of_kings_enhanced_edition_2.2.0.8.sh -rw-r--r-- 1 mean_booty mean_booty 81 Nov 3 16:40 hello_world.shI just have those two scripts.
If I try to run any shell script not in sudo, it says "permission denied" so that's why I ran these in sudo.Wouldn't it be either a paths or permissions problem since bash works on its own, but the execution alias doesn't work?
No you didn't, you ran an entirely different command in sudo. Also, never run a command with sudo just because you get permission denied. First ask yourself what the command is doing, and why you think sudo might help.
The number 1 cause of people having issues, is because they tried to run a command with sudo without knowing why.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Pages: 1