Solved

execute script from desktop

Posted on 2004-09-04
9
355 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How do I delete this file in Linux 2 453
Embeded Linux on Router 9 93
Understanding curl command 1 49
incorrect file reading in bash 7 52
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now