Solved

execute script from desktop

Posted on 2004-09-04
9
360 Views
Last Modified: 2010-04-21
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
0
Comment
Question by:hapciu
9 Comments
 
LVL 8

Expert Comment

by:da99rmd
ID: 11988071
Hi hapciu,
check the mode for the file:
ls -la a.sh
what does it say ?
/Rob
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11999647
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
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 12010671
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

Expert Comment

by:ahoffmann
ID: 12014673
>  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
 

Author Comment

by:hapciu
ID: 12022267
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
 
LVL 51

Accepted Solution

by:
ahoffmann earned 30 total points
ID: 12024024
> 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
 
LVL 22

Expert Comment

by:NovaDenizen
ID: 12027093
If the script works from the console, then the #! line is not the problem.  
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Shell script awk command 2 118
Chinese translation in RedHat 10 59
Shell script / command to generate IO / IOPS load 22 472
what is this linux system is? 16 121
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question