Find the answer to your Linux question:
Results 1 to 7 of 7
Hi guys, I m a newbie at Linux and was wondering how I can execute a shell script without using the command line. I made a shell script mdla.sh the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4

    Unhappy How to execute a shell script by clicking on it?


    Hi guys,

    I m a newbie at Linux and was wondering how I can execute a shell script without using the command line. I made a shell script mdla.sh the contents as follows:

    java -jar helloworld.jar prop.conf

    it runs fine by me typing:

    ./mdla.sh

    but when i click or double click on it nothing happens and I have full permissions on that file.

    cheers
    foo

  2. #2
    Linux Newbie objuan's Avatar
    Join Date
    Jul 2006
    Location
    california
    Posts
    234
    Hi
    to execute the file ./mdla.sh from a file manager like konueror or what every your using the file permissions need to be correct
    755 will execute the program this mean rwx-rx-rx to change the permissions from a command line as root type chmod 755 mdla.sh

  3. #3
    Just Joined!
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4
    I ready cmod the file to have 777 permissions but still no gd

  4. #4
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    339
    Quote Originally Posted by foo1234
    Hi guys,

    java -jar helloworld.jar prop.conf
    What is it supposed to do?
    Pete

  5. #5
    Just Joined!
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4
    the shell script will run the helloworld.jar file, while passing in the prop.conf as an argument. the the .jar file and .conf file are in the same directory

  6. #6
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    339
    Quote Originally Posted by foo1234
    the shell script will run the helloworld.jar file, while passing in the prop.conf as an argument. the the .jar file and .conf file are in the same directory
    I suspect the helloworld.jar file prints "Hello world" and if this is the case it will probably be working when you double-click your file but there's nowhere to print without a console.
    Pete

  7. #7
    Just Joined!
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4
    pete: I modified the code to bring up a window and display some text, which still works fine when i execute it in a console, but just does not do anything when it is clicked on the desktop.

    I want to have the files of the app (jar file and a conf file) in a directory and have a shell script to execute the app from the desktop, where the user simply needs to click on the shell script on the desktop to execute the app.

    Is this possible? or is there any way to get around this to make it happen?

    Thanks heaps guys,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •