Converting a .bat to .sh?

Discussion in 'Mac Programming' started by Thyphen, May 14, 2009.

  1. macrumors newbie

    May 14, 2009
    Well I am wondering if there is a way to convert something from a .bat to a .sh...

    I am guessing you have to completly change it but I was wondering if someone knew how...

    The code is as follows
    @echo off
    title RSCD
    java -classpath rscd.jar;lib/xpp3.jar;lib/xstream.jar;lib/hex-string.jar;lib/mail.jar;lib/activation.jar;lib/jmf.jar org.rscdaemon.client.mudclient
    Could someone make a mac do exactly that but with a .sh?
  2. macrumors 68040


    Jan 10, 2005
    Dallas, TX
    you could, but i don't know why you'd want to.

    java -classpath rscd.jar;lib/xpp3.jar;lib/xstream.jar;lib/hex-string.jar;lib/mail.jar;lib/activation.jar;lib/jmf.jar org.rscdaemon.client.mudclient >/dev/null 2>&1 &
    This in a sh file will run the command for you, but you won't need to keep a terminal occupied to run the thing.
    could take the place of

    If you really wanted to the terminal to stay up after execution. I think title is just setting the command prompt's window title in Windows? Not really necessary, but:
    echo "^[]0;"RSCD"^G"

    should set the title. To type ^[ and ^G, type ctrl+v, then ctrl+esc or ctrl+g.

  3. thread starter macrumors newbie

    May 14, 2009
    Hmmm I used that code and this is the error i got...

    Usage: java [-options] class [args...]
               (to execute a class)
       or  java [-options] -jar jarfile [args...]
               (to execute a jar file)
    where options include:
        -d32          use a 32-bit data model if available
        -d64          use a 64-bit data model if available (implies -server, only for x86_64)
        -client	  to select the "client" VM
        -server	  to select the "server" VM
        -jvm	  is a synonym for the "client" VM  [deprecated]
        -hotspot	  is a synonym for the "client" VM  [deprecated]
                      The default VM is client.
        -cp <class search path of directories and zip/jar files>
        -classpath <class search path of directories and zip/jar files>
                      A : separated list of directories, JAR archives,
                      and ZIP archives to search for class files.
                      set a system property
                      enable verbose output
        -version      print product version and exit
                      require the specified version to run
        -showversion  print product version and continue
        -jre-restrict-search | -jre-no-restrict-search
                      include/exclude user private JREs in the version search
        -? -help      print this help message
        -X            print help on non-standard options
                      enable assertions
                      disable assertions
        -esa | -enablesystemassertions
                      enable system assertions
        -dsa | -disablesystemassertions
                      disable system assertions
                      load native agent library <libname>, e.g. -agentlib:hprof
                        see also, -agentlib:jdwp=help and -agentlib:hprof=help
                      load native agent library by full pathname
                      load Java programming language agent, see java.lang.instrument
                      show splash screen with specified image
    /Users/troydickerson/Desktop/Troy/RSCDevil/Aus-Bot ~MubbY/rsbot: line 1: lib/xpp3.jar: No such file or directory
    /Users/troydickerson/Desktop/Troy/RSCDevil/Aus-Bot ~MubbY/rsbot: line 1: lib/xstream.jar: No such file or directory
    /Users/troydickerson/Desktop/Troy/RSCDevil/Aus-Bot ~MubbY/rsbot: line 1: lib/hex-string.jar: No such file or directory
    /Users/troydickerson/Desktop/Troy/RSCDevil/Aus-Bot ~MubbY/rsbot: line 1: lib/mail.jar: No such file or directory
    /Users/troydickerson/Desktop/Troy/RSCDevil/Aus-Bot ~MubbY/rsbot: line 1: lib/activation.jar: No such file or directory
  4. macrumors 604


    Aug 13, 2002
    Did you move the project from a windows machine? did you bring over the directory structure that shows up in the CLASSPATH over?

Share This Page