PDA

View Full Version : [ubuntu] double-click should just run the script



boondocks
February 16th, 2010, 02:43 AM
I have a shell script. I set the permissions:
chmod 755 ./run_it

So now it is.
-rwxr-xr-x

I open Nautilus File Browser.
Go to the folder that contains "run_it"

I double-click on "run_it" because I want it to run.

Instead of running this shell script, I get the message:
Do you want to run "run_it", or display its contents?
With the buttons...
<Run in Terminal> <Display> <Cancel> <Run>

So I click on the <Run> button to run it.

Is there any way to make the script just run by default
and not display this message at all?

chewearn
February 16th, 2010, 05:32 PM
For a workaround, right-click on the desktop, select "Create Launcher", point it to the script. Now, double-click on the launcher will run the script immediately without asking.

mcduck
February 16th, 2010, 06:10 PM
I have a shell script. I set the permissions:
chmod 755 ./run_it

So now it is.
-rwxr-xr-x

I open Nautilus File Browser.
Go to the folder that contains "run_it"

I double-click on "run_it" because I want it to run.

Instead of running this shell script, I get the message:
Do you want to run "run_it", or display its contents?
With the buttons...
<Run in Terminal> <Display> <Cancel> <Run>

So I click on the <Run> button to run it.

Is there any way to make the script just run by default
and not display this message at all?
By default, Nautilus is set to ask what you want to do when you click on a text file that's also set to be executable.

You can set the behavior you want in the file manager's preferences. (the options are to always view the file, always execute the file, or ask what to do).