execute script from desktop

i have an script file a.sh
i can run it in the console from it's folder with ./a.sh
how do i make it run from my (kde) desktop ? if i click it it says "Cannot find program 'a.sh' !"

thanks
hapciuAsked:
Who is Participating?
 
ahoffmannConnect With a Mentor Commented:
> ahoffmann: I don't want to make it work only for my computer (relative to my loaction of a.sh).
what does this mean?
my suggestion uses full paths, if it shuld work on other computers you need something common (like the path, or the PATH, HOME, etc. environment variables)
0
 
da99rmdCommented:
Hi hapciu,
check the mode for the file:
ls -la a.sh
what does it say ?
/Rob
0
 
ahoffmannCommented:
in the kde control center or an menu on your panel, there is a Item called "Add application" (or alike)
there you need to choce an application type and specify the full path to your a.sh.
This presumes that a.sh is a bourne shell script and executable (mode 555 for example), other whise the command to give for the application is:
   /bin/sh /full/path/to/a.sh
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
NovaDenizenCommented:
Make sure that the first line of your script is:
#!/bin/sh

"Cannot find program 'a.sh'" is a perennially bad error message in Unix.  It's the kernel saying that it can't find the shell script interpreter, even though it looks like it's saying that it can't find the shell script.
0
 
ahoffmannCommented:
>  It's the kernel saying that it can't find the shell script
it's the shell saying that it cannot find the specified program in the paths given in PATH environment variable
0
 
hapciuAuthor Commented:
da99rmd : it doesn't work even if i set permissions to full: chmod 777 a.sh

NovaDenizen : the first line of my script is #!/bin/bash . is that a problem ? if it can't find the interpreter than why does it work from the console ?

ahoffmann: I don't want to make it work only for my computer (relative to my loaction of a.sh).

The thing is that I have a java application. To run it i made a very simple script that starts the java virtual machine and loads my app. I would like to distribute the script along with the application so the users can just run the script to start the app. it works from the console, but I would like it to work from the dektop also.

thank you for your answers
0
 
NovaDenizenCommented:
If the script works from the console, then the #! line is not the problem.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.