What do i need to type in to run this .sh file on my mac.

Discussion in 'Mac Apps and Mac App Store' started by wigwan27, Apr 17, 2009.

  1. wigwan27 macrumors newbie

    Apr 3, 2009
    Well my son came up to me and asked me for my help. I'm a bigger PC user myself because of work. My son however has a mac PowerBook G4 and is wanting to play a game on it and came to me to see if i could help. He says he knows the .sh file can be run through a application called terminal (Which i have found so far.) But I'm clueless past this point. If this isn't possible say so. This way my sons life won't be sucked up by yet another game. Thanks.

    (Heres the download incase you need it by the way.)
  2. aaron11193 macrumors regular


    Mar 27, 2009
    Karumba/Cairns/Charters Towers, QLD, Australia
    go into terminal.

    $ su -

    $ cd [path to .sh file]

    $ chmod -x [name of .sh file].sh

    $ sh [.sh file].sh

    Pretty sure that will work.
  3. bootedbear macrumors 6502


    Sep 13, 2004
    Austin, TX
    Why the "su"? That puts the user into "superuser" mode and can be very dangerous.

    You should just be able to just run the shell script without the need for superuser access.
  4. njl macrumors regular

    Mar 15, 2009
  5. reclusivemonkey macrumors 6502


    Jun 2, 2008
    Sowerby Bridge, West Yorkshire, UK
    Bootedbear has it right. You don't need to make the script executable if you are going to run it with sh.

    A word of warning though, this could be anything. Be very wary of running scripts you don't know about on your computer. Mac are pretty secure as a rule, but actually running something you know nothing about has the potential to be catastrophic.
  6. angelwatt Moderator emeritus


    Aug 16, 2005
    Looks like there's 2 .sh files with that download, a compile.sh and run.sh. Both are just running some java commands (you can open the files in a text editor and you'll see it tells you how to change permissions on the file). There's also versions of the same file without any extension that run the same command.

    From Terminal you can cd into the directory where it's at then,
    bash compile
    But you'll likely find as I did that it won't compile, there's errors. It doesn't seem to be complete code as there was a missing semicolon as one of the errors and even if you fix it there'll be other errors. If you create a bin folder in the main folder it'll compile, but then it still has errors when you try to run it.

    In my opinion, if it's this ill-written, it's not worth running on your machine as it could hurt something on your computer. Not saying it's malicious, just poorly coded.

    As a note, from some of the files included it looks like this was originally coded in Eclipse. It's possible Eclipse may be able to compile it better, but that's a bit of a maybe. Eclipse is a big download too so you likely don't want to install it just to try this.

Share This Page