./nameofscript
which is of course nice, when you are in a terminal.but creating a launcher for such a script is a pain, so here is what I do.
For this example we will pretend we have a shellscript called "shakespear" and it lives in the /home/jim/apps folder. This name is only for our example - you can use any name you like.
Somewhere, such as your home folder, create a file called shakespear.sh
edit the file to have the following in it:
#! /bin/bash
cd /home/jim/apps
./shakespear
And save itThen make that file to executable:
chmod u+x shakespear
.sh
Now you can just create a launcher to point to that shakespear.sh file, and you are all set. Calling a script from a script may not be the the best way to do it, but it works...
9 comments:
thanks !!!
i was looking for that !!!
I have been pulling my hair out trying to get a launcher to run a script. I am using Ubuntu Hardy and your suggestion, was the first that I have found that actually worked. Thanks.
Quite helpful! Workarounds for the win =]
Really cool stuff! Looked for hours to find a solution for this simple hard thing ..
Thank you.
Very helpful.
Short and sweet. Cheers!!
Why not simply use a command to combine change of working directory and script execution there -
sh -c "cd directory; ./script.sh"
no need for second script.
what a genius, i'd been looking for that for years
Post a Comment