0

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.

TheOdd
  • 3,012
yeyint
  • 21
  • 1
  • 3

1 Answers1

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