Hey people! Ok i have a quick question. I've written a simple yes no bash script. I know i can run it from the terminal but i was wondering if there's anyway of executing it by means of double clicking it with the mouse. Please keep in mind I'm brand new to bash.
Announcement
Collapse
No announcement yet.
Execute .sh file by double clicking
Collapse
X
-
Tags: None
- Top
- Bottom
-
How are you running the script in the terminal? If you are using the source or . commands the execute permission is not checked.
To check if the script is executable in dolphin, right click the file, properties, permissions tab, check "Is executable", or in a konsole, it should look something like
Code:$ ls -l *.sh -rwxrwxr-x 1 john john 99 Aug 29 13:59 t.sh
If it is marked executable, there can be other reasons dolphin doesn't want to run it. In dolphin's settings, configure dolphin, General, confirmations tab, there is the "When opening an executable file" drop down; I have it set to "always ask".
If the script is on removable media, the media is normally mounted with the "noexec" option, but the source command will still work IIRC.Regards, John Little
- Top
- Bottom
Comment
-
Hiya Jittle!! Thanks for getting back to me. When i execute the files i do it through the terminal by entering ./ before the .sh file.
the ls command gave me the following:
-rwxrwxr-x 1 yikes yikes 319 Oct 30 17:37 chatgpt2revised.sh
-rwxrwxr-x 1 yikes yikes 317 Oct 30 17:17 chatgpt.sh
-rwxrwxr-x 1 yikes yikes 116 Nov 1 17:29 exist.sh
-rwxrwxr-x 1 yikes yikes 32 Oct 30 16:55 fselect1.sh
-rwxrwxr-x 1 yikes yikes 181 Nov 1 17:36 gemini.sh
-rwxrwxr-x 1 yikes yikes 339 Nov 1 17:42 getopenfilename.sh
-rwxrwxr-x 1 yikes yikes 103 Nov 1 17:33 kdgetfileopen.sh
-rwxrwxr-x 1 yikes yikes 339 Oct 30 17:57 kdialog.sh
-rwxrwxr-x 1 yikes yikes 735 Nov 1 16:50 kyesno.sh
-rwxrwxr-x 1 yikes yikes 137 Nov 1 17:09 mygo.sh
-rwxrwxr-x 1 yikes yikes 147 Oct 31 17:34 newyesno.sh
-rwxrwxr-x 1 yikes yikes 366 Oct 31 17:22 texttomsg.sh
-rwxrwxr-x 1 yikes yikes 502 Oct 30 19:00 vpn1.sh
-rwxrwxr-x 1 yikes yikes 735 Nov 1 17:50 vpnconnect.sh
-rwxrwxr-x 1 yikes yikes 735 Nov 1 17:56 vpnyesnodisconnect.sh
-rwxrwxr-x 1 yikes yikes 195 Oct 31 17:31 yesno.sh
Is there anything more i can add to help me sort this out?
- Top
- Bottom
Comment
-
Ok the weirdest thing just happened. I looked at the two files that do actually run. Both of them had#!/bin/bash
In hindsight probably posted the code here, I don't doubt you guys would have picked up on the error.
Thanks for your help Jittle!!
- Top
- Bottom
Comment
Comment