Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Running .sh problems?

  1. #1
    Join Date
    May 2013
    Beans
    6

    Question Running .sh problems?

    Hello everyone,

    I'm attempting to run a .sh file, but I'm encountering issues. I've already changed its permissions to allow execution, but when I double click the icon, no window asking if I would like to run the script appears. I ran this file just fine on every version of Ubuntu 12 I used. but I'm having issues now that I've switched to Ubuntu 13. Any advice?

  2. #2
    Join Date
    Mar 2008
    Beans
    1,219

    Re: Running .sh problems?

    Quote Originally Posted by armistice90 View Post
    I've already changed its permissions to allow execution, but when I double click the icon, no window asking if I would like to run the script appears.
    If a file is marked executable, it's executed silently. Why would you need a confirmation dialog anyway?

  3. #3
    Join Date
    Jan 2013
    Location
    Eastern Europe
    Beans
    Hidden!
    Distro
    Lubuntu

    Re: Running .sh problems?

    hehe ...hello!

    Try through terminal Ctrl+T!

    You need to install korn shell program-thingy.
    Code:
    sudo apt-get install ksh
    then open your executable file.
    Code:
    sh "filename"
    or
    Code:
    sudo sh "filename"
    or
    Code:
    sudo ksh "filename"

  4. #4
    Join Date
    Mar 2008
    Beans
    1,219

    Re: Running .sh problems?

    Quote Originally Posted by Locus Kiesselbachi View Post
    or
    More like not. ;) A .sh file is very likely a bash script which, depending on what's inside, may be incompatible with sh/ksh.

  5. #5
    Join Date
    Jan 2013
    Location
    Eastern Europe
    Beans
    Hidden!
    Distro
    Lubuntu

    Re: Running .sh problems?

    Well, sometimes it helped me trying to get .sh thingy running.

  6. #6
    Join Date
    May 2013
    Beans
    6

    Re: Running .sh problems?

    I suppose I didn't clarify too well. I'll click, and it opens with gedit instead of prompting if I want to run the file. I've always recieved a prompt in the past when using 12

  7. #7
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    4,171
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Running .sh problems?

    What's the intended result of the script?
    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
    .

  8. #8
    Join Date
    May 2013
    Beans
    6

    Re: Running .sh problems?

    It's supposed to run a visual novel.

  9. #9
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    4,171
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Running .sh problems?

    Is it a long script?

    Maybe in it's somewhat short, like a page or so, you could post it and we could review what's at fault.

    If you choose to, please use the code tags from the reply box toolbar (# symbol)
    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
    .

  10. #10
    Join Date
    May 2013
    Beans
    6

    Re: Running .sh problems?

    Sure thing. It's rather short, so here it is.

    Code:
    #!/bin/sh
    
    # We assume Darwin means Mac OS X. Sorry, Darwin guys.
    if [ "x`uname -s`" = "xDarwin" ]; then
        dir=`dirname "$0"`
        dir=`cd "$dir"; pwd`
        base=`basename "$0"`
    
        export RENPY_LAUNCHER_DIR="$dir"
    
        if [ -e "$dir/${base%.sh}.app/Contents/MacOS/${base%.sh}" ] ; then
            launcher="$dir/${base%.sh}.app/Contents/MacOS/${base%.sh}"
        else
            launcher="$dir/${base%.sh}.app/Contents/MacOS/Ren'Py Launcher"
        fi
    
        exec "$launcher" "${0%.sh}.py" "$@"
    fi
    
    exec "`dirname \"$0\"`/lib/python" "-OO" "${0%.sh}.py" "$@"

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •