[SOLVED] Annoying message: Do you want to run "xyz.sh", or display its contents?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Linux Mint 13 Cinnamon Edition 64-bit, Windows 7 Home Premium SP1 64-bit, Arch Linux 32-bit
Posts: 161
Rep:
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.
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.
Distribution: Linux Mint 13 Cinnamon Edition 64-bit, Windows 7 Home Premium SP1 64-bit, Arch Linux 32-bit
Posts: 161
Original Poster
Rep:
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.
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.
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).
Distribution: Linux Mint 13 Cinnamon Edition 64-bit, Windows 7 Home Premium SP1 64-bit, Arch Linux 32-bit
Posts: 161
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.