Results 1 to 7 of 7

Thread: How to make .sh file run when I click it?

  1. #1

    Default How to make .sh file run when I click it?

    Hi. I know that if I want to use .sh files, I need make it executable and to execute
    "./shfile.sh"
    command.

    But my question is as follows : I don't know why, but when I click on any .sh file, a program launches with "Wine Windows Program Loader" name and I see wine's icon jumping for a few seconds near my cursor. Then it disappears. I know Wine shouldn't be used to open .sh files, I don't know why it's so. I can for example use Kwrite to open it and even make it default program for opening, but what when I want to execute it? I mean, what command should I type in "Open in.." window?


    I prefer to use Yakuake, so it would be great if you could tell me the command for yakuake, not Konsole.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,871

    Default Re: How to make .sh file run when I click it?

    I do not know if this helps (I e.g. have not Wine, so I can not test what you do).

    You should be aware of the fact that a file ending in the characters .sh does not need to be a shell script (for any shell). It is only used by a lot of people so they reccocnise it as such.

    A script should have in its first line the so called shebang:
    Code:
    #!/bin/bash
    or what ever the path and name of the interpreter is, being it bash, sh,zsh, pyton, ....
    When this is not the case in your script, please add this and try if it helps.
    Henk van Velden

  3. #3
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    1,770

    Default Re: How to make .sh file run when I click it?

    Also, make sure that you make your script "executable".
    Code:
    chmod +x shfile.sh
    openSUSE 12.3 (x86_64) with Kernel 3.7.10-1.16-desktop and KDE 4.11.2 on MacBook Pro
    Latest MS Windows version used: Win95

  4. #4
    Join Date
    Nov 2013
    Location
    US
    Posts
    12

    Unhappy Re: How to make .sh file run when I click it?

    ive tried to install second life and anjunta so far for Gnome and both extract fine but dont show up in the list of programs. im very new to linux so i dont know how to install new programs without using YaST.

  5. #5
    Join Date
    Nov 2013
    Location
    US
    Posts
    12

    Cool Re: How to make .sh file run when I click it?

    Quote Originally Posted by nexussage02 View Post
    ive tried to install second life and anjunta so far for Gnome and both extract fine but dont show up in the list of programs. im very new to linux so i dont know how to install new programs without using YaST.
    ive switched to KDE and i can install stuff now.

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to make .sh file run when I click it?

    On 2013-11-04 19:46, nexussage02 wrote:
    >
    > ive tried to install second life and anjunta so far for Gnome and both
    > extract fine but dont show up in the list of programs. im very new to
    > linux so i dont know how to install new programs without using YaST.


    There are several methods, depending on what exactly you want to
    install. You have to read the instructions of whatever you install.

    If you want to run a shell script, which is the subject of this thread,
    it will never show in the list of programs. To run it you have to mark
    it executable, and then call it by its name. It has to be saved
    somewhere in the path, or else call it the full path and name.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.3 x86_64 "Dartmouth" at Telcontar)

  7. #7
    Join Date
    May 2010
    Location
    Space Colony Lagrange Point 22° à, 77° Ƅ, 56° ɤ, 99° ɜ
    Posts
    3,166

    Default Re: How to make .sh file run when I click it?

    nexussage02 wrote:
    >
    > ive tried to install second life and anjunta so far for Gnome and both
    > extract fine but dont show up in the list of programs. im very new to
    > linux so i dont know how to install new programs without using YaST.
    >
    >

    If you have configured the openSUSE repos *properly* then the best way
    to install anjunta(you mean't anjuta right) is using YaST installer
    (Install/Remove Software) application from Activities

    --
    GNOME 3.6.2
    openSUSE Release 12.3 (Dartmouth) 64-bit
    Kernel Linux 3.7.10-1.16-desktop

Posting Permissions

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