LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-18-2013, 04:31 PM   #1
CamTheSaxMan
Member
 
Registered: Nov 2013
Distribution: Linux Mint 13 Cinnamon Edition 64-bit, Windows 7 Home Premium SP1 64-bit, Arch Linux 32-bit
Posts: 161

Rep: Reputation: 9
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
 
Old 12-18-2013, 04:35 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,433

Rep: Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043Reputation: 2043
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.
 
Old 12-18-2013, 09:15 PM   #3
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

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

Cheers
 
Old 12-20-2013, 08:29 PM   #4
CamTheSaxMan
Member
 
Registered: Nov 2013
Distribution: Linux Mint 13 Cinnamon Edition 64-bit, Windows 7 Home Premium SP1 64-bit, Arch Linux 32-bit
Posts: 161

Original Poster
Rep: Reputation: 9
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.
 
Old 12-21-2013, 03:40 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 5,719

Rep: Reputation: 1319Reputation: 1319Reputation: 1319Reputation: 1319Reputation: 1319Reputation: 1319Reputation: 1319Reputation: 1319Reputation: 1319Reputation: 1319
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.
 
Old 12-21-2013, 10:07 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,344

Rep: Reputation: 1450Reputation: 1450Reputation: 1450Reputation: 1450Reputation: 1450Reputation: 1450Reputation: 1450Reputation: 1450Reputation: 1450Reputation: 1450
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).
 
Old 12-21-2013, 04:54 PM   #7
CamTheSaxMan
Member
 
Registered: Nov 2013
Distribution: Linux Mint 13 Cinnamon Edition 64-bit, Windows 7 Home Premium SP1 64-bit, Arch Linux 32-bit
Posts: 161

Original Poster
Rep: Reputation: 9
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.
 
  


Reply

Tags
bash, message, script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
black screen and message "cannot display this mode 2:dvi-d" diring F11 install landonmkelsey Linux - Software 4 08-18-2009 10:47 AM
Annoying message "Syslogd@localhost" marmen Linux - Newbie 3 09-20-2007 11:55 AM
Start up problem after message "Precaution disk will run out of memory" Suse Q+A SUSE / openSUSE 1 10-23-2006 08:03 AM
K3b: - Howto re-dock "Directories" and "Contents" windows back into the main window? hagies Linux - Software 4 04-26-2006 08:38 AM
When running a script I get a box asking "Run or display ?" I want it to just run aaronruss Linux - Newbie 4 05-28-2004 12:03 AM


All times are GMT -5. The time now is 07:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration