Rappel concernant les règles de confidentialité de Google
Lire
Résultats de recherche
launcher - How to execute a script just by double clicking like ...
https://askubuntu.com/questions/138908/how-to-execute-a-script-just-by-double-clicking-like-exe-files-in-windows
How can I make a bash script executable by double clicking just like .exe files in Windows? I... PLUS
How can I make a bash script executable by double clicking just like .exe files in Windows? I tried creating a launcher and assigning the script to it, but there are two consequences:
• the terminal twinkles, disappears, and nothing is done.
• you must specify to run in terminal in order to work.
I have a script that installs tomcat on an offline PC, including all dependencies of tomcat in the script. I need to make the script work on double clicking like windows since most who use the script will not be familiar with Ubuntu.
Forget the above explanation. I want to make a script that can be run by double-clicking on it, without using the terminal. Anybody knows how?
9 answers
Answer 1 of 9
100 votes
I tested this and it worked fine. Ensure your script begins with the correct hash-bang, e.g. #!/bin/bash
Then follow these steps:
Hit Alt+F2, type dconf-editor and hit Enter.
In dconfg-editor goto: org ➤ gnome ➤ nautilus ➤ preferences
Click on executable-text-activation and from drop down...
Answer 2 of 9
55 votes
On the newer versions, on nautilus (files), go to Edit > preferences > Behaviour tab > and change the settings for executable text file.
Answer 3 of 9
8 votes
In Ubuntu and all Unix based OSes, afaik, nothing is set as executable by default. There are two ways of doing this.
• Right click on the script or file you want to execute. Go to Properties then to the Permissions Tab. Click the check box that says Execute.
• Open a Terminal cd into the...
Answer 4 of 9
3 votes
I think creating a *.desktop file is missing here:
$ cat shortcut-for-my-script.desktop
[Desktop Entry]
Type=Application
Terminal=true
Name=Click-Script
Icon=utilities-terminal
Exec=gnome-terminal -e "bash -c './script.sh;$SHELL'"
Categories=Application;
If you create more than one *.desktop...
Answer 5 of 9
2 votes
If you're using XFce then you can make script executed in Thunar by executing this command:
xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default \
--create --type bool --set true
or by using gui xfce4-settings-editor and creating the same property
Answer 6 of 9
1 votes
You have to check 3 points :
• Nautilus / Nemo configuration : https://askubuntu.com/a/286651/301025
• The script file must be executable: https://askubuntu.com/a/275714/301025
• The file system must allow execution :
• Type mount in a console
• Check if your file system has the noexec flag
•...
Answer 7 of 9
0 votes
When you create a launch in Desktop to a SHEL script or Whatever, in command line, don't forget to signal the script, to be executed in background.
The script will die when he finished is job.
Answer 8 of 9
0 votes
Based on umask defualt value, you haven't execute permissions for files by default and must change mod to gain execute permissions, something like this:
chmod u+x filename
Answer 9 of 9
-1 votes
Specially for Android Studio You can follow my original answer here:
To Create Desktop Launcher:
• Click on Create Desktop Entry.. from Tools menu.
• It will be prompt for password, enter password of your current login.
• Finally it will be display notification in Android Studio screen like:
•...
bash - Double Click Shell Script in Ubuntu 16.04 Nautilus only ...
https://unix.stackexchange.com/questions/286044/double-click-shell-script-in-ubuntu-16-04-nautilus-only-gives-the-user-option-to
When I follow the steps in
... PLUS
When I follow the steps in
[https://askubuntu.com/questions/138908/how-to-execute-a-script-just-by-double-clicking-like-exe-files-in-windows]
I used to get a dialog box asking whether I wanted to execute the shell script or edit it using gedit. I just reinstalled Ubuntu Linux 16.04 with a LiveCD and ran sudo apt-get install mono-complete. Now , when I double click the shell script in Ubuntu 16.04 Nautilus I only can edit the shell script file.
The contents of this shell script are:
#!/bin/bash
exec /usr/bin/mono-service.exe ./AudioRecorder.exe "$@".
as specified in
[http://www.mono-project.com/archived/guiderunning_mono_applications/]
Why is this problem occuring and how do we fix it so double click the shell script in Nautilus asks me if want to execute the shell script file?
Any help is greatly appreciated.
2 answers
Best Answer
1 votes
First of all, /usr/bin/mono-service.exe does not exist.
Next, according to your posted link. Your script should read something like this:
#!/bin/sh
/usr/bin/mono /usr/lib/mono/4.5/mono-service.exe ./AudioRecorder.exe "$@"
or
#!/bin/sh
/usr/bin/mono-service ./AudioRecorder.exe "$@"
or
...
Answer 2 of 2
0 votes
Here is the URL I found which answers the question.
Double click Linux Bash Script and debug with pause commands
@terdon's answer is really nice:
Your script needs a terminal for you to interact with it. One way of doing that is what @Sebastian suggested. However, note that bash
scripts are...
Quand je double click sur un ".sh" ça se lance avec gedit aulieu ...
https://forum.ubuntu-fr.org › Forum › Terminal, scripts et ligne de commande
4 mai 2013 - 9 messages - 6 auteurs
en ligne de commande, situe-toi dans le dossier qui contient ton fichier .sh et tu entres la commande file ton_fichier.sh, tu auras la réponse... La commande file détermine le type du fichier. Exemple: ~$ file install-depot-multisystem.sh install-script - Documentation Ubuntu - Ubuntu-fr
https://doc.ubuntu-fr.org/tutoriel/script_shell
Écrire un script. Si vous voulez écrire un programme sh, vous avez deux possibilités : soit vous tapez dans un shell toutes les commandes. ou alors vous ... Par la suite, un double-clic sur l'icône vous laissera le choix entre afficher le fichier (dans un éditeur de texte) et le lancer (directement ou dans un terminal pour voir ...How to make scripts execute by double-clicking on Ubuntu/Linux Mint ...
https://www.youtube.com/watch?v=Hf5xDsiJdmw
24 mai 2014 - Ajouté par ALucio
Bored of starting scripts from bash? Watch this video! :) In this tutorial, I will show you how to make a bash file ...[ubuntu] Open .sh files with double click.. - Ubuntu Forums
https://ubuntuforums.org/showthread.php?t=1495476Traduire cette page
28 mai 2010 - So, as the title says, I want to run a shell script (Matlab program) by double clicking on it. Presently, I can open it by either typing ./matlab in the terminal or by creating a launcher and choosing the 'run in terminal' option. Is there anyway to just run it with a simple double click? :-?7 janv. 2011
executing shell script in terminal directly with a double click ...
https://www.linuxquestions.org/.../programming.../executing-shell-...Traduire cette page
5 oct. 2005 - 15 messages - 8 auteurs
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 ... Location: Belgium. Distribution: Ubuntu. Posts: 133. Rep: Reputation: 15shell script executes in terminal but not with double click on ...
https://stackoverflow.com/.../shell-script-executes-in-terminal-but-...Traduire cette page
6 déc. 2013 - The program adb is not found. Deternime in the terminal where the program is: which adb. and then replace the adb calls in your script with those values, for exmaple: /usr/bin/adb pull /sdcard/MovingGratings ~/Documents/AndroidData/ubuntu - double-click to run .sh file - Super User
https://superuser.com/questions/131104/double-click-to-run-sh-fileTraduire cette page
15 avr. 2010 - Your problem is that when you try to run your shell script by double clicking it, your system by default will run it in your home directory. When arriving at the line # start programm and pass any parameters java -Xmx512M -jar "$How to execute a bash script by double clicking just like .EXE files in ...
https://junise.wordpress.com/.../how-to-execute-a-bash-script-by-d...Traduire cette page
24 janv. 2016 - It is really easy to make a bash/terminal script by double clicking it just like we do in windows .exe files. Just continue with the following scripts. Type your script using some text editors like gedit. Save this with this some filename. Ensure your script begins with the correct hash-bang, e.g. #!/bin/bash.