Results 1 to 4 of 4

Thread: How to open shell script graphically

  1. #1
    Join Date
    Nov 2013
    Location
    Manitoba Canada
    Beans
    46

    How to open shell script graphically

    I have a file x.sh that's supposed to run the application x. If I open the terminal, navigate to the directory the file's in and run the command ./x.sh, x opens. If, on the other hand, I navigate to the file graphically and left-click on it, the file opens in gedit for editing. If I right-click on it and look at "opens with", it says that files ending in .sh are to be opened in gedit. Should I be changing gedit to something else? If so, what? Is there something I should be doing instead in order to get x to run when I left-click on x.sh?

    Leslie

  2. #2
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to open shell script graphically

    Make it executable in x.sh file properties.

  3. #3
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    11,158
    Distro
    Ubuntu

    Re: How to open shell script graphically

    In Files you need to reset the executable preferences.
    it defaults to display, you need to set to to run or ask.
    Unfortunately you haven't provided any information about which release this relates to, but for Ubuntu 18.04 the help page for it is here:
    https://help.ubuntu.com/lts/ubuntu-h...havior.html.en
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    19,863
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: How to open shell script graphically

    Linux doesn't care about extensions. Some GUI programs do care about extensions.
    All files have "permissions." As dragonfly41 says above, changing the permissions to include "eXecute" probably will fix it, but you'll need to double-click the file, not single-click.

    The contents of the x.sh file may not be sufficient for it to be run through a GUI. Can you please post the first line? If that line doesn't provide an interpreter in the correct format, it probably won't run. Which interpreter should be used depends on the language the script is written in.

    There are some settings which might prevent running programs on a specific file system. This is a security setting and not enabled by default on Ubuntu systems to my knowledge. However, as Linux desktops become more popular, we are being attacked and it might be time to prevent the execute permission bit from working on all mounts. That's a very different discussion, however.

Bookmarks

Posting Permissions

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