I have an executable file in my home directory (/home/user/filename/filename.sh
). I am a non-root user. How do I make this script launch by typing the name in terminal? Not using the cd
command, chmod
command, and ./
. I also want to launch the script by clicking just the application icon.
Asked
Active
Viewed 2,549 times
0
-
1We are here to help. So, no need to put that in title. Edit your question with a better title please. – Anwar Oct 09 '16 at 03:45
-
To make it double clickable u first have to to use chmod! And everytime time chmod when u put object file on different machines – minigeek Oct 09 '16 at 03:51
-
1And http://askubuntu.com/q/138908/158442 – muru Oct 09 '16 at 05:39
1 Answers
0
cat <script here> | /bin/bash.
This will print the contents of the script and pipe it to /bin/bash.
Note that if you use this method, the shebang (#!/path/to/shell) will not work. Replace /bin/bash with the shell of your choice.
If you want to launch the application from the GUI, make a .desktop file for it.
[Desktop Entry]
Name=<Name>
Exec=<command>
Terminal=false
Type=Application
StartupNotify=false
Place the .desktop file in the same directory as your script.
By the way, chmod works if you are the owner of the script (and chmod is executable).

id01
- 101