I'm trying to create a shortcut that will run a .sh file deep in some directory without having to navigating to the absolute path.
I have tried using aliases, which did not work as. Using soft/hard links, they did not work too as there are certain dependencies in that directory which the shell script reference to.
Anyone has any idea how to ./
a file without having to traverse down that absolute path?
The alias I have tried is :
alias minecraft='/var/www/owncloud/data/admin/files/Spigot/start.sh'
I have tried the Path variant by adding PATH=/var/www/owncloud/data/admin/files/Spigot:"$PATH"
into ~/.bashrc
.
Which then brings the message :
Error: Unable to access jarfile spigot.jar
I'm using a cli version of Ubuntu if it helps, so no Nautilus.
PATH
environmental variable....BTW whats the problem you are having with alias? – heemayl Feb 25 '15 at 15:38cd /full/path/to/my/
at the beginning of your script (after #! /bin/bash) to make sure that all relative paths are looked up from the directory the script is located in. – Byte Commander Feb 25 '15 at 15:41cd
are also given). – muru Feb 25 '15 at 16:12Exec=
line to:Exec=sh -c "cd /path/to/scriptfolder&&./script.sh"
(Ah, @muru indeed a perfect dupe) – Jacob Vlijm Feb 25 '15 at 16:12