.sh file failing to run even with run permissions (SOLVED)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Satellite Slickers
Level 1
Level 1
Posts: 5
Joined: Wed Mar 22, 2023 3:25 pm

.sh file failing to run even with run permissions (SOLVED)

Post by Satellite Slickers »

i am attempting to run a .sh file but every time i try to it just opens it in a text editor.
i already went to properties -> permissions and made sure that the box for allowing it to run as a program is checked, but it still only opens in the text editor and when i go to open with i dont see anything either. is there something that im missing?
Last edited by LockBot on Sat Sep 23, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
powerwagon75
Level 4
Level 4
Posts: 339
Joined: Sun Feb 28, 2016 4:05 pm
Location: USA

Re: .sh file failing to run even with run permissions

Post by powerwagon75 »

Does the first line of your script look like this: #!/bin/bash?

Your permissions are something similar to this? (Don't have to match this example, just make sure execute is selected for "Owner" as a minimum. ) Did you create this as your user, or root?
execute-box.png
execute-box.png (19.81 KiB) Viewed 247 times
Are you not seeing this when you double-click on it?
file-open-dialogue.png
Image
Custom Antec Outside tower w/Mint 20.2
HP lap w/Mint 20.3
Optiplex 960 "Frankenbox" w/Fedora 39/Mint 19.2/Mint 20.2
Advantech TPC-1551T w/LinuxLite
Acer C720 Chromebook w/GalliumOS
Mac PPC G4 w/Lubuntu
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: .sh file failing to run even with run permissions

Post by trytip »

Satellite Slickers wrote: Thu Mar 23, 2023 8:10 pm is there something that im missing?
we're missing the script and the errors you get
Image
Satellite Slickers
Level 1
Level 1
Posts: 5
Joined: Wed Mar 22, 2023 3:25 pm

Re: .sh file failing to run even with run permissions

Post by Satellite Slickers »

powerwagon75 wrote: Thu Mar 23, 2023 8:55 pm Does the first line of your script look like this: #!/bin/bash?

Your permissions are something similar to this? (Don't have to match this example, just make sure execute is selected for "Owner" as a minimum. ) Did you create this as your user, or root?
execute-box.png

Are you not seeing this when you double-click on it?
file-open-dialogue.png
When I double click on it it just opens in a text editor, no prompt or error or anything.
I'm using Thunar as my file manager and the permission tab in properties looks like this at the moment
Attachments
Screenshot from 2023-03-23 18-48-31.png
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: .sh file failing to run even with run permissions

Post by trytip »

Satellite Slickers wrote: Thu Mar 23, 2023 9:57 pm
doubleclick scripts in xfce won't work. some desktops like mate,cinnamon give you option to open as text or run script in terminal.
for you, open Terminal in folder where ServerStart.sh is located and run ./ServerStart.sh
Image
Satellite Slickers
Level 1
Level 1
Posts: 5
Joined: Wed Mar 22, 2023 3:25 pm

Re: .sh file failing to run even with run permissions

Post by Satellite Slickers »

trytip wrote: Thu Mar 23, 2023 10:36 pm
Satellite Slickers wrote: Thu Mar 23, 2023 9:57 pm
doubleclick scripts in xfce won't work. some desktops like mate,cinnamon give you option to open as text or run script in terminal.
for you, open Terminal in folder where ServerStart.sh is located and run ./ServerStart.sh
thank you very much. im going to mark this as solved now
Locked

Return to “Beginner Questions”