Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

sh inanities

Name: Anonymous 2008-12-24 8:55

    Hello /comp/.

    I am trying to install a pirated game on my linux machine. I generally don't go in for much piracy, you understand, but it is a 9 year old game and stuff. It got a special linux release, but I can't make it work. Can you help?

    The readme just says to mount the CD and run sh setup.sh as root, but when I do this it throws up an error message:

    setup.sh: 9: function: not found

    I don't understand shell scripts at all, you understand, but ot my eyes there is nothing wrong with the file. line 9 is just a function declaration:

    function DetectARCH {

    So, does /g/ have any ideas? It seems unlikely to me, but the only possibility that springs to mind is that sh is implemented differently in modern linux these days and you have to declare them differently or... something. But that seems fairly farfetched.

    Oh, incidentally, the game in question is Railroad Tycoon II.


Here is the top of the file, where it is apparently going wrong. It does manage to kick out "x86" to the terminal though, so it must be getting somewhere in that function, at least.

    #!/bin/sh
    #
    # Product setup script - Loki Entertainment Software

    # Go to the proper setup directory (if not already there)
    cd `dirname $0`

    # Return the appropriate architecture string
    function DetectARCH {
    status=1
    case `uname -m` in
    i?86) echo "x86"
    status=0;;
    *) echo "`uname -m`"
    status=0;;
    esac
    return $status
    }

Name: Anonymous 2008-12-26 9:19

try changing #!/bin/sh to #!/bin/bash

Don't change these.
Name: Email:
Entire Thread Thread List