executing shell script in terminal directly with a double click
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
executing shell script in terminal directly with a double click
Hi,
I have written a shell script named install.sh. I have placed the script on my Debian Desktop. Generally in order to execute this script, we follow these steps:
1.Open a terminal
2. cd /path/to/shellscript
3. type "sh install.sh" to execute
Now, I am trying to automate the entire above process. What I want is that when the user double clicks the shell script on the Desktop with mouse, it should execute in terminal in the usual way.
Also, when I right click on the script and click on 'Open', the GNOME gives me 4 options:
'Run in Terminal'
'Display'
'Cancel'
'Run'
I know that selecting the first option ''Run in Terminal'' looks like a probable option, but I don;t want the trouble of even right clicking on the file. This is because the target users of this script have no knowledge of Linux(assuming).
There fore I want the script to launch the terminal and start executing as soon as the user double clicks on it.
executing shell script in terminal directly with a double click
Hello,
In Gnome :
- right click on the desktop and 'create launcher'
- browse to the script location and give a name
- don't specify 'run in terminal'
- change the icon to user friendly one
This should work fine.
I think the user must have executable rights on the script.
--
free_ouyo
Re: executing shell script in terminal directly with a double click
Quote:
Originally posted by free_ouyo Hello,
In Gnome :
- right click on the desktop and 'create launcher'
- browse to the script location and give a name
- don't specify 'run in terminal'
- change the icon to user friendly one
This should work fine.
I think the user must have executable rights on the script.
--
free_ouyo
Dude thanks for the idea. It worked but one change. I had to check the box for 'Run in Terminal'. Without that it just won't do anything.
executing shell script in terminal directly with a double click
Hello,
Try to run this little script from custom launcher without 'run in terminal' and take a look at the '/tmp' after running, on my system, it create the file and write the text without having seen something at the screen.
#!/bin/bash
touch /tmp/shortcut.txt
echo "Hello World !" >> /tmp/shortcut.txt
Re: executing shell script in terminal directly with a double click
Hey All,
You can run the shell script by a double-click on it, by following the below steps:
> Create the script and save it in a file.
> Right click on that file.
> Goto 'Open With'
> Goto 'Open With other application
> You can find 'Use a custom command' at the bottom. Click on that.
> Click on 'Browse'
> Select 'gnome-terminal' from the files in the /usr/bin/
> Click on 'Add'
> Then click on 'Close'
Now whenever you double click on that file it will run in the terminal.
And if you want to edit that file, open it with vi editor or right click and select open with any other editor.
Since Nov 10th, I have not been able to doubleclick to execute a .sh; I can not chmod the file (nothing is changed as `ls -la Pharo.sh` shows.
WHen I create a launcher I get "Permission denied'. This is understandable since the file is not executable.
I have found no way to start my Pharo Smalltalk. Here is the Pharo.sh file:http://pastebin.ubuntu.com/536076/
The previous instructions to set up a launcher fails because the file is not executable and I have not found a way to set it executable - either from 'context'->permissions or via chmod.
It is possible to copy the entire smalltalk (pharo version) distribution to a local folder and change the permissions for Pharo.sh and for ../Contents/Linux686/squeak.
The previous instructions to set up a launcher fails because the file is not executable and I have not found a way to set it executable - either from 'context'->permissions or via chmod.
It is possible to copy the entire smalltalk (pharo version) distribution to a local folder and change the permissions for Pharo.sh and for ../Contents/Linux686/squeak.
You have to change your 'mount' setting - FAT32 volumes should be mounted with 'x' permission added by default to all files.
Need execute permissions on vfat volumes when they automount
Quote:
Originally Posted by Sergei Steshenko
You have to change your 'mount' setting - FAT32 volumes should be mounted with 'x' permission added by default to all files.
I would like to know the exact fstab line I need.
I have the following one, and still have a problem doubleclicking on Pharo.sh (a smalltalk startup file):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.