0

I'm new to Linux and am trying to find the equivalent of this from Windows

@echo off
if ".%1" == "." goto TellSyntax
set
PRE_CLASSPATH=%MW_HOME%\oracle_common\modules\javax.persistence_2.1.jar;%MW_HOME%\wlserver\modules\com.oracle.weblogic.jpa21support_1.0.0.0_2-1.jar
goto End
:TellSyntax
echo setJPA21SupportPatch %MW_HOME%\wlserver\modules
:End
echo PRE_CLASSPATH=%PRE_CLASSPATH%
  • Hi and welcome to the site. While I'm sure some of us know Windows scripting, most of us don't. This is a site about Unix and Linux. Please edit your question and explain what the script is supposed to be doing. – terdon Mar 14 '15 at 0:02
  • you're right, as I say I am newbie in computing but in general , this bash is to configure weblogic server with JPA 2.1, the bash configure persistence on the server. – This bash I found it here: docs.oracle.com/middleware/1213/wls/EJBAD/… – Richard Mar 14 '15 at 0:06
  • 1
    Please edit your question and explain what it does. And "it configures a weblogic server" is not an explanation. You seem to require certain variables to be set but only if some conditions are met. Please edit your question and explain what each step of the script does so we can understand what you need. You should also tell us what shell you will be using. Should this be done in sh, in bash, zsh? Something else? Will it only run on Linux? Unix as well? OSX? – terdon Mar 14 '15 at 0:08
  • 1
    Your terminology is very poor. You are not talking about translating a bash script from Windows to Linux; you are talking about translating a Windows batch file to a Linux bash script. You say, "This bash I found it here (at oracle.com)" when you mean "I found the batch file that I want to translate (at oracle.com)". But, finally: what this batch file does is to set an environment variable. It is impossible for an ordinary Unix/Linux shell script to do that. Identify the bigger picture of what you want to accomplish, research that (try to figure it out), and then come back here. – G-Man Says 'Reinstate Monica' Mar 14 '15 at 0:34
  • P.S. A big -1 to Oracle for blithely saying, "A similar script can be written for Linux, UNIX, or Macintosh." – G-Man Says 'Reinstate Monica' Mar 14 '15 at 0:36
1

For WebLogic, I've done something similar when setting the PRE_CLASSPATH variable. It would look something like this:

PRE_CLASSPATH=${MW_HOME}/oracle_common/modules/javax.persistence_2.1.jar:${MW_HOME}/wlserver/modules/com.oracle.weblogic.jpa21support_1.0.0.0_2-1.jar
export PRE_CLASSPATH

However, I strongly suggest you look more into learning the basics of bash. Setting an environment variable is a very standard task that you should have mastered before going forward.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.