r/linux4noobs • u/Fuckthatfuckingshit • 21d ago
shells and scripting unable to open .sh file
I'm currently trying to install a program using a .sh file on linux nobara, I have tried to make it an executable, but I can only seem to open the raw code and not the program itself. It does have the permissions to be executed and run as a program, but I'm hitting a wall with my trouble shooting.
If I run it as an executable, nothing happens.
If I open with Kate, I get the raw code.
If I run in console I get the message "fatal error: no prefixes found. Run the game once and then try again."
Any ideas on how to make it work?
Edit for the first few lines:
cd "$(dirname "$0")"
STEAM_PATHS=(
"$HOME/.steam/steam"
"$HOME/.local/share/Steam"
"$HOME/snap/steam/common/.local/share/Steam"
"$HOME/steam/root"
"$HOME/steam"
"$HOME/.var/app/com.valvesoftware.Steam/.steam/steam"
"$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam"
"$HOME/.var/app/com.valvesoftware.Steam/.steam/root"
"$HOME/.var/app/com.valvesoftware.Steam/.steam"
)
LUTRIS_PATH="$HOME/Games"
BOTTLES_PATHS=(
"$HOME/.var/app/com.usebottles.bottles/data/bottles/bottles"
"$HOME/.local/share/bottles"
15
u/fox_in_unix_socks 21d ago
Sounds like the script is running but throwing an error. Can't really advise much further without knowing what the script is supposed to be doing.
4
u/Classic-Rate-5104 21d ago
Show us at least the first lines of the script, and the permissions
2
u/Unique_Low_1077 Arch btw 21d ago
Show us the raw code and we might be able to help
9
u/anciant_system 21d ago
The script is looking for a wine/proton prefix, so start the game through your usual software then start the script, and it should be good
1
u/MaurokNC 21d ago
Try entering the file name as ./name.sh
1
u/urjuhh 21d ago
Try from terminal: file yourfile.sh
What does it say ?
1
u/Quietus87 21d ago
At least tell us what script you are trying to run and why are you fumbling with a script at all. Most applications are available in some repository or as flatpak.
1
u/RAMChYLD 21d ago edited 21d ago
Did you start your file with a
#!/bin/bash ?
That line is called the hashbang, and it’s very important as it tells your current shell that it is a shell script and optionally to switch to the indicated shell to run the script. Some python intepreted type programs even use it.
0
u/don_bski 21d ago
Try adding the -x option when staring the script. This tells bash to echo each script line to the console for debug purposes. See https://stackoverflow.com/questions/951336/how-can-i-debug-a-bash-script for more.
0
u/[deleted] 21d ago
[deleted] — view deleted comment