Passing arguments to weblogic shell

Hello:
I am trying to pass several(but undetermined) arguments to a weblogic shell scripts. I can´t use multiple -v options as I don´t know the number of arguments. My idea is the following:
wlsh -f script.wls -v variables="variable1 variable2 variable3"
Inside the script there is a loop and what I wan to do is
for $i in $variables
print $i
end
I only see the value variable1, Any idea?
Regards.

I execute as ' . ./temp.sh 1 2 3 '
and temp.sh is as simple as :-
echo $1 $2 $3Don't preceede the command with the '. '
Just run the command as './temp.sh 1 2 3'.

Similar Messages

  • How to run a java class from a shell script with passing arguments

    hi,
    I have a jar with all the required classes. I was using ant to run the classes i needed.
    But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
    So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
    Thanks in advance.

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • Passing argument to shell script from java program

    str="/bin/sh -c /root/PWAppSh/StartSH.sh";
    p = rt.getRuntime().exec(str);
    above is the code snippet of java program for calling the shellscript
    when i pass a argument to the shell script from my java program it wont get accepted in shell script as an input
    when i do following changes in above code it wont work :---
    str="/bin/sh -c /root/PWAppSh/StartSH.sh para1 para2 para3 ";
    p = rt.getRuntime().exec(str);
    para1,para2 and para3 wont get as argument for the shell script
    how this can be done
    thanks
    reply "ARGENT"

    Argent.
    Read this:
    Navigate yourself around pitfalls related to the Runtime.exec() method

  • Passing arguments to main method from a shell script

    The main method of my class accept more than 10 arguments so my shell script execute this class like this :
    java -cp xxxx mypackage.MyClass $*
    The problem is that some of those arguments allows spaces. When i execute this script like this :
    myscript.sh firstparam secondparam ...... tenthparm "eleventh param"
    or
    myscript.sh firstparam secondparam ...... tenthparm 'eleventh param'
    the java class consider that my eleventh param is 'eleven' and not 'eleventh param'
    The same class works well with an equivalent dos script.

    I had this problem once also, and I found there are several ways to fix it. One way is to replace all of the spaces in the arguments with _ characters, or you can concantate all of the arguments into one String at runtime (with spaces in between) and use code to separate the arguments out. With the quotation marks, this code would be simple. If the spaces in one argument are used to divide different parts of the argument, just make them spearate arguments.

  • How to pass arguments to .sql file.......

    Hello,
    I want to pass arguments to .sql file which is being called from within a shell (.sh).
    suppose this is the line in shell -
    ${ORACLE_HOME}/bin/sqlplus -s abcuser/abcuser@abc < ${ABCDB_DIR}/A.sql $val >>${LOG}
    - now I want to pass '123456' to A.sql
    Please suggest how to do that.
    Thanks and regards,

    You can pass parameters to a shell script executing sql commands just like you would any other shell script.
    I have a script called test_os_variables.sh:
    sqlplus -s "/ as sysdba" << EOF
    select '$1' from dual;
    EOF
    Now I execute my script passing SHAWN as a parameter.
    ./test_os_variables.sh SHAWN
    SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jan 9 08:09:46 2007
    Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL>
    'SHAW
    SHAWN

  • Passing arguments to Managed Server ServerStart when using Node Manager

    Below is the procedure to pass arguments to Managed Server serverstart tab when using Node Manager to start and stop the Managed Server instance
    For passing the JVM arguments we will have to use "-server" which is hotspot and then pass the arguments
    for eg: "-server -Xms2048m -Xmx2048m -verbosegc"
    For adding jar's to the classpath you will have to add weblogic.jar and weblogic_sp.jar from WL_HOME/server/lib directory as well along with the custom jar (In some cases we can ignore weblogic_sp.jar, just adding weblogic.jar will do).
    for eg: "\home\user\debug.jar;\home\user\bea\wlserver_10.3\server\lib\weblogic.jar;\home\user\bea\wlserver_10.3\server\lib\weblogic_sp.jar;"
    - - Tarun

    Hi,
    To me, if you don't wanna use the NodeManager, you won't be able to start your managed servers with WLST.
    I guess the only ways are :
    * through the console / WLST using the NodeManager
    * using the startManagedWebLogic.[cmd/sh]
    Regards

  • Passing arguments to props when starting Admin Server

    I need to pass arguments to StartAdminServer.py  using props:
         nmConnect(userConfigFile=sys.argv[2],userKeyFile=sys.argv[3],host=sys.argv[4],port=sys.argv[5],domainName=sys.argv[6],domainDir=sys.argv[7],nmType='plain')
         ARG8 = sys.argv[8]
         print ARG8
         props=makePropertiesObject('Arguments="-server -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m -XX:CompileThreshold=1000 -Djava.security.egd=file:/dev/./urandom -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.log.RedirectStdoutToServerLogEnabled=true -Dweblogic.Stdout=sys.argv[8]"')
         print props
         #nmStart(sys.argv[6] + '-admin',props=props)
    Output:
    Successfully Connected to Node Manager.
    -Dweblogic.Stdout=/opt/deploy/oracle/middleware/weblogic/user_projects/logs/prod-r2wpublisher-ins2/prod-r2wpublisher-ins2-admin/prod-r2wpublisher-ins2-admin.out
    {Arguments=-server -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m -XX:CompileThreshold=1000 -Djava.security.egd=file:/dev/./urandom -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.log.RedirectStdoutToServerLogEnabled=true -Dweblogic.Stdout=sys.argv[8]}
    I am wondering if there is any  way to pass this command line arg to props. This value changes from server to server and I do not want that to be hardcoded on py.
    Thanks in advance.

    Thanks Jay for the immediate responses.
    The thing I am worried about is it seems the behavior in Weblogic 10.0.2 seems to be in consistent with the behavior in Weblogic 10.0.0.
    In Weblogic 10.0.2, even if the JAVA_OPTIONS in setDomainEnv.sh do not include the paramaters that are set in "Server Start->Arguments", when starting the managed servers, they are picked up as can be seen from the managed server log files.
    However, in Weblogic 10.0.0, it seems that these options are not picked up when they are configured in "Server Start->Arguments". Only when they are configured in setDomainEnv.sh are they picked up.
    Do you have any info which points to this discrepancy?

  • How to pass argument to the Java Plugin JVM w/o using the Control Panel?

    I want to deploy an applet to be loaded by the Java Plug In
    and fix some settings of its Java Virtual Machine.
    The JPI Control Panel offers two ways to pass arguments to the JVM,
    none satisfactory.
    1. while interactive via the Control Panel Window.
    This cannot be a solution for a deployed applet.
    or
    2. by editing the system generated file that stores
    the settings of the Plugin Control Panel, using a property
    named javaplugin.jre.params.
    The problem with this method is that if forces to access
    and edit this property file which is stored at various locations
    depending the client platform. Then, it may collide with other
    settings for other applets.
    Is there a way to pass the arguments to the JVM
    from within the html file?
    Has anyone found a solution to this question?
    JPS

    I am interested in this issue as well.
    Did anyone find a reliable way to specify the runtime parameters that should be used by the Java Plug-in in order to execute a given Java applet?
    I believe a good place to specify these runtime parameters would be the applet's JAR manifest: only digitally signed applets should be able to set the desired runtime parameters...
    Any comments / suggestion would be greatly appreciated.
    Regards,
    Marco.

  • How to pass argument in manifest file

    Hi,
    I want to pass argument to main class in jar. Is there any option in manifest file.

    Hmm..
    Seems that my sentence above isn't so correct.
    It possible to add custom attribute: value pairs into manifest file and
    read it later from Java class.
    Here is code sample:
    public class ManifestTest {
        public static void main(String[] args) {
            try {
                java.util.jar.JarFile jar = new java.util.jar.JarFile(System.getProperty("java.class.path"));
                for (java.util.Iterator it = jar.getManifest().getMainAttributes().keySet().iterator();it.hasNext();) {
                    Object curKey = it.next();
                    System.out.println("key: " + curKey + ", value: " + jar.getManifest().getMainAttributes().get(curKey));
            } catch (Throwable t) {
                System.out.println("exception occured: " + t);
    }

  • How can I pass arguments to a TestStand sequence with LabWindows 6 ?

    Hi
    I have created sequences in a TestStand file.
    I want to program a sequence with Labwindows 6 which would call all these existing sequences (containing parameters).
    I don't have any problems to create the steps "SequenceCall" but i don't know how to pass arguments to the sequences with the TS API.
    I have used the look-up strings "TS.SData.SFPath", "TS.SData.SeqName", "TS.SData.ThreadOpt" to program the sequence file / sequence and the multithread option. But now how to program the arguments passing ? I think there is something with the lookup string "ST.SData.ActualArgs"...
    Thank u very much for any help

    I'm not sure if you want to pass values from TestStand to LabWindows or if you want to pass values in TestStand from a sequence call step to a called sequence.
    To get TestStand variables from LabWIndows, use the following function:
    tsErrChk (TS_PropertyGetValNumber(testData->seqContextCVI, &errorInfo, "Locals.StartPoint", 0, &dStartPt));
    iStartPt = (int)dStartPt;
    The TS_PropertyGetValNumber gets the TestStand variable Locals.StartPoint and puts it into the LabWindows variable called dStartPoint. Numbers to and from Test Stand are always a double type. The next line converts it to an integer.
    To put a LabWindows value to TestStand, use TS_PropertyPutValNumber.
    To pass values from a sequence call step to a called sequence, create variables in the Parameters t
    ab on your main sequence. Create same variables on the Parameters tab of the called sequence. In main, specify module to be called in calling step. There is a paramters section on the Edit Sequence Call dialog box which appears. Check the Use Prototype of the Selected Sequence box. You can then list all the parameter variables in the parameters section.
    Hope this is what you want.
    - tbob
    Inventor of the WORM Global

  • Passing Arguments in a Multiple JFrame project

    I am trying to pass Arguments from MainApp.java to SubApp.java.
    Is there someone that have an example or fix the sample program included?
    tks a lot
    sage49
    I based my program on the following 2 programs that I got from this forum!!
    The following is the MainApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class MainApp extends JFrame {
        MainApp() {
            super( "Main Application" );
            JButton button = new JButton( "Show Sub Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
    //  need to pass a string to SubApp in the following line
                    JFrame app = new SubApp();
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            MainApp app = new MainApp();
    }The following is the SubApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class SubApp extends JFrame {
    // need to accept a String as Arguments
        SubApp() {
            super( "Another Application" );
            JButton button = new JButton( "Show Main Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new MainApp();
                    dispose();
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            SubApp app = new SubApp();
    }

    Hi,
    I have done what you suggested, Now I get an error on the subApp on the main.
    see What I tried in the code.
    MainApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class MainApp extends JFrame {
        MainApp() {
            super( "Main Application" );
            final String a ="this is the string";
            JButton button = new JButton( "Show Sub Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new SubApp(a);
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
            MainApp app = new MainApp();
    }The SubApp.java
    import javax.swing.*;
    import java.awt.event.*;
    class SubApp extends JFrame {
            private String mystring;
            SubApp(String mystring) {   
            super( "Another Application" );
            this.mystring = mystring;
            JButton button = new JButton( "Show Main Application" );
            button.addActionListener( new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                    JFrame app = new MainApp();
                    dispose(); 
            getContentPane().add( button );
            setDefaultCloseOperation( DISPOSE_ON_CLOSE );
            pack();
            show();
        public static void main( String[] args ) {
           // tried    =    SubApp app = new SubApp(mystring);
           // tried    =    SubApp app = new SubApp(a);
           // tried    =    SubApp app = new SubApp(String a);  
           // tried    =    SubApp app = new SubApp(String);                 
            SubApp app = new SubApp();                // this is the line I get the error
    }I get the following error:
    Cannot find Symbol
    symbol  : constructor SubApp()
    location: class SubApp
            SubApp app = new SubApp();Tks a lot
    sage49

  • Creating pocess intance of a different process and passing arguments

    Creating Process instance of a different process:
    I have two different process: Main_Flow (id: MainFlow) and Second_Flow (id: SecondFlow). In the first process I am reading a csv file. Each line of the file has four columns. After reading each line I have to initiate Second_Flow and pass the read data from the file. (Pls find the code below for the whole process):
         fileReader = FileReader(arg1 : fullFileName);//filename is of file type and have file name and path
         Java.Io.BufferedReader reader = BufferedReader(arg1 : fileReader);
         String str;
         int countLines = 0;
         while ((str = reader.readLine()) != null)
              strColumn = str.split(delim : ",");
                   int ColumnCnt = 0;
                   while (ColumnCnt < 4)
                        //defining variables
                        String appNo;
                        String custNo;
                        String loanAmm;
                        String loanDate;
                        //logMessage("Value at Column: " + ColumnCnt + " is " + strColumn[ColumnCnt]);
                        if (ColumnCnt == 0)
                             arrLoanData["appNo"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 1)
                             arrLoanData["custNo"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 2)
                             arrLoanData["loanAmm"] = strColumn[ColumnCnt];
                        else if (ColumnCnt == 3)
                             arrLoanData["loanDate"] = strColumn[ColumnCnt];
                        arrLoanData["descriptionArg"] = "AutoInstance: " + formatTime('now', timeStyle : Time.SHORT);
                        arrLoanData["genByArg"] = "Automatic";
                        ProcessInstance.create(processId : "/SecondFlow", arguments : arrLoanData, argumentsSetName : "BeginIn");
                        ColumnCnt = ColumnCnt + 1;
              countLines = countLines + 1;     
    (“The code is in Java and not in PBL”)
    I have to pass appNo, custNo, loanAmm and loanDate as the arguments. The Argument will be of Any[String] type. The argument set name of Second_Flow is “BeginIn”. But I am not getting anything in Second_Flow.
    What can I do in the argument mapping of begin of Second_Flow to get the passed argument (array)?

    the argument 'arguments' for the method ProcessInstance.create receives a map of the arguments that the 'argumentSetName' argument set will receive.
    so for example if your second flow has 2 arguments, String name, Decimal value and String[] content your method invocation would be:
    ProcessInstance.create(processId : "/SecondFlow", arguments : {"name": strNameFromCsv, "value": valueFromCsv, "content": ["a","b","c","d"]}, argumentsSetName : "BeginIn");

  • How to pass argument in main function ?

    How to pass arguments in main function of one class from another class ?
    I don't want to pass argument from command prompt.
    I want to try something like this -
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
         System.out.println(args);
    class Fun{
    public static void main(String args[]){
         Test t=new Test("Hello","good bye");
    when i run Fun class it gives error.
    Suggest me how can i do that.

    In Fun class main method does not take arguments that is fine. In Test class instead of main method you can have constructor to take input parameters as suggested by BalusC
    However, if you want to make your existing code work, you can call (though not appropriate) main() method of Test class from main() method of Fun class (As main() method is static object is not required to invoke this):
    Test.main(new String[]{"Hello","good bye"});Here is your code:
    class Test{
    public static void main(String args[]){
    for(int i=0;i<args.length;i++)
    System.out.println(args);
    public class Fun{
    public static void main(String args[]){
    //Test t=new Test("Hello","good bye");
    Test.main(new String[]{"Hello","good bye"});
    } Thanks,
    Mrityunjoy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Passing arguments to a custom component in the constructor

    I would like to know if it is possible to pass arguments to a
    custom component in the constructor when I'm instantiating it
    within Actionscript. I've not seen anyone do this, so at the moment
    I have a couple of public properties defined on the custom
    component and then do the following:
    var myComponent:TestComponent = new TestComponent();
    myComponent.propertyOne = true;
    myComponent.propertyTwo = 12;
    etc.
    Whereas I'd like to do something like:
    var myComponent:TestComponent = new TestComponent( true, 12
    Any ideas if this is possible?

    Another approach as opposed to creating init function is to link symbol with autogenerated class (just assign it a class but do not create *.as file for it) and use it just as graphical view with no functionality (well only MovieClip's functionality).
    ViewClip.as
    public class ViewClip extends MovieClip {
        public var view:MovieClip;
        public function ViewClip(){
            this.view = instantiateView();
            this.addChild(view);
        protected function instantiateView():MovieClip {
            return new MovieClip();
    Circle.as
    public class Circle extends ViewClip {
        public function Circle(scaleX:Number, scaleY:Number) {
            super();
        override protected function instantiateView():MovieClip {
            return new ClassView();

  • Pass arguments to JSF tag attributes like id oder value

    Hi!
    I started with JSF some weeks ago and have some questions that i could not find in FAQ or tutorials.
    My page structure uses some <jsp:includes>. Each included page uses JSF.
    The structure is (example - users):
    Users.jsp
    |
    |(incl)
    |
    Mainpage.jsp (=Framework)
    |
    |(incl)
    |
    Browser.jsp (=Table)
    In "Users" all specific data is set. In "Browser" there is a <h:form> tag and a <h:dataTable> tag.
    The result should be a simple table with users inside.
    So I want to pass arguments to those sub-pages.
    1) -> form-ids as parameter:
    <h:form id="#{sessionScope.formName}">
    ... does not work, because ids have to start with a character or "_".
    formName is set as followed:
    session.setAttribute("formName", "form_users");
    2) ->beans as parameter:
    <h:dataTable id="browser_table_#{sessionScope.id}" styleClass="browser_table"
    var="user" value="#{sessionScope.user_list}">
    ... does not work. "id" is requested to be a static value and "value" can't find the bean by this string.
    user_list is set as followed:
    session.setAttribute("user_list", "UserListBean.users");
    (UserListBean.users is an ArrayList)
    Is there an error in my thinking? Or is there a way to pass arguments as i want?
    Thanks!

    sorry ... mistake in topic: "oder" = "or" of course :)

Maybe you are looking for