Welcome to the Linux Foundation Forum!

Translations

Hey i have a run.bat for rsps i know noob. but i would like help translating the .bat into shell and im new to linux so please help me. the code is

@echo off



if exist "%HOMEDRIVE%\Program Files (x86)" goto x64

goto x32

pause



:x32

"%HOMEDRIVE%/Program Files/Java/jre6/bin/java.exe" -Xmx500m Jframe 10 0 highmem members 32

pause



:x64

"%HOMEDRIVE%\Program Files (x86)\Java\jre6\Bin\Java.exe" -Xmx500m Jframe 10 0 highmem members 32

pause

please can you translate this into shell so i can run the rsps.

-thanks,

danb

Comments

  • woboyle
    woboyle Posts: 501
    On Linux systems, the system should know where java is installed, so you really don't need to do any of the stuff in your script but can easily just execute the command:
    java args
    
    However, if you may have both 32 and 64 bit java installed on your system and want to execute the 64-bit version if it is, and 32-bit if not, then for "if exist dirname goto nnn" use this
    if [ -d dirname ]; then do this; else do that; fi
    
    So, in your case, this is something like what you want (modify to suit):
    if [ -d 64bit-java-dir-path; then 64-bit-java-dir-path/java -Xmx500m jframe 10 0 highmem members 32;
    else java -Xmx500m jframe 10 0 highmem members 32; fi
    

Categories

Upcoming Training