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. Thanks |
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 |
Thanks will try and let you know
|
Re: executing shell script in terminal directly with a double click
Quote:
thank you once again. |
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 -- free_ouyo |
Actually if you read my question, I have said that I want to see the terminal screen, but with just a double click on the file. That;s it.
thanks |
Is there another way to do this if you're not using GNOME?
I'm using xfce. |
I put this at the top of my bash scripts:-
Code:
tty -s; if [ $? -ne 0 ]; then konsole -e "$0"; exit; fi |
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. Cheers, Iqbal S. |
Execute .sh files in FAT volumes
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/ |
@AVT,
It's the same. R click on the panel> Add item> Launcher, and away you go. |
Problem executing .sh file in FAT volume
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. |
Quote:
|
Quote:
|
Need execute permissions on vfat volumes when they automount
Quote:
I have the following one, and still have a problem doubleclicking on Pharo.sh (a smalltalk startup file): /dev/sdb1 /home/intrader/windata vfat users,rw,umask=000,dmask=000,fmask=000 0 0 I expect the vfat volume to automount to /home/intrader/windata with execute permissions (ideally only for .sh files). I don't quite know what to make of your konsole submission - what is it? |
All times are GMT -5. The time now is 07:44 PM. |