LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Annoying message: Do you want to run "xyz.sh", or display its contents? (https://www.linuxquestions.org/questions/linux-newbie-8/annoying-message-do-you-want-to-run-xyz-sh-or-display-its-contents-4175488476/)

CamTheSaxMan 12-18-2013 04:31 PM

Annoying message: Do you want to run "xyz.sh", or display its contents?
 
So I have this certain game that I like to play, but it requires the disc. I've made an iso of the disc and made a bash script that mounts the image, starts the game, and unmounts the image when the game is closed. The problem is that every time I try to run the script, I get this message:

Do you want to run "thescript.sh", or display its contents?
"thescript.sh" is an executable text file.

The script is marked as executable and I've run it several times, but each time, I'm prompted with this annoying message. I also have to type in my password since I'm mounting/unmounting a filesystem. Why the mount command needs root priveliges when you can just click mount in nemo without root is beyond me, but that's a different issue. How can I disable this message. It only appears when I open scripts that I created.

I'm using Linux Mint 13 Cinnamon

suicidaleggroll 12-18-2013 04:35 PM

It's an honest question, because you're opening an executable text file. How does the DE know if you want to open it to run it or open it to edit it?

The best course of action IMO would be to put this shell script somewhere proper, such as in ~/bin/, and then create a launcher for it on your desktop or taskbar.

gdejonge 12-18-2013 09:15 PM

Also make sure you got a shebang line as the first line in your script. Something like '#!/bin/sh'.

Cheers

CamTheSaxMan 12-20-2013 08:29 PM

Yes. my script begins with #!/bin/bash and is marked as executable. When I click on it, I want to run it. If I'd want to edit it, I'd right-click, Open With > Geany.

ondoho 12-21-2013 03:40 AM

it's file manager specific.
some execute by default, if the script has the executable bit set.
if you don't want to install a new file manager, go with suicidaleggroll's suggestion.

rknichols 12-21-2013 10:07 AM

I'm not familiar with what the default file manager is in Linux Mint, but in nautilus, you can open the Edit->Preferences dialog and select the "Behavior" tab. The options under "Executable Text Files" allow you to select "Run", "View", or "Ask" (the default).

CamTheSaxMan 12-21-2013 04:54 PM

Thanks rknichols! That's what I was looking for. It's the same in Nemo (it is a fork of nautilus), so I checked "Run". I didn't know the file manager handled that. Marking as solved.


All times are GMT -5. The time now is 08:48 PM.