Solved

execute script from desktop

Posted on 2004-09-04
9
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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