Urgent Problem in Executing perl script from shell script

Hello,
I've a shell script on one server (source) and a perl script on another (target).
My perl script will check whether the directoryname, filename provided by shell script exists on the target server or not.
My shell script is as follows:
#! bin/bash
cmd=`ssh user@target "perl /home/user/test_dir/validate_file.pl"`
echo $cmd
And my perl script uses a package CU_Functions.pm, which is in the same directory as the perl script on the target server.
But when I invoke the perl script from shell script, I get the following error:
Source:user> (db:ias10g12_mid_db) /home/user/perl
$ sh /home/user/arcs/arcs_conn.sh
user@target's password:
Can't locate CU_Functions.pm in @INC (@INC contains: /local/perl-5.6.1/lib/5.6.1/i686-linux /local/perl-5.6.1/lib/5.6.1 /local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux /local/perl-5.6.1/lib/site_perl/5.6.1 /local/perl-5.6.1/lib/site_perl .) at /home/user/test_dir/validate_file.pl line 13.
BEGIN failed--compilation aborted at /home/user/test_dir/validate_file.pl line 13.
Please let me know if I need to do any configurations prior to call the perl script.

As for the Perl INC, I cannot recall the environment variable that sets that but the following example should work:
ssh user@host "export ENV_VAR=/path/to/include/files:$ENV_VAR ; /full/path/to/script"

Similar Messages

  • How To Execute SQL Statements From Shell Scripts?

    I need to extecute some SELECT statements from a shell scripts. Could anybody kindly tell me how to do that, or which document i should refer to ? Thank you very much!

    You can execute SQLPlus with the SQL in a file (sqlplus -s @<sql-script>).

  • Calling sql script from shell script

    Hi,
    I know this question has been asked many time in various forums, but I tried many combinations and not able to figure out what I'm missing.
    Basically - I'm trying to call a sql script from a shell script.
    This is my sql script (plsql.sql) -
    DELCARE
    v_empno NUMBER := '&empno';
    BEGIN
    select ename,sal from emp where empno = v_empno;
    dbms_output.put_line('Inside the plsql file');
    END;
    This is my unix shell script - I'm caling the plsql.sql file with the parameter passed(97882). I don't get any output. at least I should be able to view the dbms output if not for the sql query inside the sql script.
    #!/usr/bin/ksh
    sqlplus -s sam/olo01 << HERE
    @plsql.sql 97882;
    HERE
    What is it I am missing ?

    Using your scripts (and having to create and populate a table myself, that would have what your select statement implies),
    oracle:oklacity$ cat plsql.sql
    DELCARE
    v_empno NUMBER := '&empno';
    BEGIN
    select ename,sal from emp where empno = v_empno;
    dbms_output.put_line('Inside the plsql file');
    END;
    oracle:oklacity$ cat doit.sh
    #!/usr/bin/ksh
    sqlplus -s sam/olo01 << HERE
    @plsql.sql 97882;
    HERE
    oracle:oklacity$ ./doit.sh
    SP2-0042: unknown command "DELCARE" - rest of line ignored.
    SP2-0734: unknown command beginning "v_empno NU..." - rest of line ignored.
    oracle:oklacity$
    This is the kind of information you should have put in your opening post.

  • Problem while calling concsub from shell script

    Hi All,
    I am facing problem when I am trying to run CONCSUB utility from shell script.The same works well when I try it from command line.The only prob I am facing from shell script is assigning values to temporary variables.
    This is how my script looks
    #!/bin/bash
    export PARM5="$5"
    export PARM6="$6"
    export PARM7="$7"
    echo "INTPARM5=\"$PARM5\""
    echo "INTPARM6=\"$PARM6\""
    echo "INTPARM7=\"$PARM7\""
    echo $FND_TOP/bin/CONCSUB $1 ONT 'Order Management Super User, Vision Operations (USA)' $3 WAIT=Y CONCURRENT ONT $PROGRAM "$INTPARM5" "$INTPARM6" "$INTPARM7"When I try to run the above shell based concurrent program it doesn't pass the parameters as expected and it errors out saying "Wrong number of arguments to call the procedure"
    I tried my luck from some of the previous posts ({thread:id=2360776} ),but to vain
    If anyone has any ideas,please suggest!!
    Thanks in advance!!
    Edited by: sandy on May 4, 2013 12:54 PM

    Here are your proofs
    Proocedure
       PROCEDURE abc(--p_errbuf            OUT   VARCHAR2,
                                                --p_errcode           OUT   VARCHAR2,
                                 p_order_no          IN    NUMBER DEFAULT NULL,
                                                p_customer_id       IN    NUMBER DEFAULT NULL,
                                 p_name              IN    VARCHAR2 DEFAULT NULL
          IS
                    v_cname    VARCHAR2(200);
               v_ordered_date DATE;
               v_order_number  NUMBER;
              v_order_type    VARCHAR2(200);
    BEGIN
                fnd_file.put_line(fnd_file.output, 'Begin Execution');
       SELECT DISTINCT ac.customer_name,
                    d.ordered_date ordered_date,
                    d.order_number order_number,
                    x.NAME order_type
            INTO   v_cname
               ,v_ordered_date
               ,v_order_number
               ,v_order_type
               FROM oe_order_headers_all d,
                    oe_transaction_types_tl x,
                    wsh_delivery_details b,
                    wsh_delivery_assignments c
                    ,ar_customers ac
              WHERE 1 = 1
                AND ac.customer_id = b.customer_id
                AND d.order_type_id = x.transaction_type_id
                AND x.LANGUAGE = 'US'
                AND b.released_status = 'B'
                AND b.source_header_id = d.header_id
                AND c.delivery_detail_id = b.delivery_detail_id
                AND d.order_number=NVL(p_order_no,d.order_number)
                AND ac.customer_id = NVL(p_customer_id,ac.customer_id)
             AND x.name=NVL(p_name,x.name)
                AND NOT EXISTS (SELECT 1
                                FROM wsh_delivery_details b
                               WHERE 1 = 1
                                      AND b.released_status != 'B'
                                      AND b.source_header_id = d.header_id)
                                       --BETWEEN ('1213794') and ('1213797'))
                AND rownum<2;
            INSERT INTO xxc_temp(customer_name,ordered_date,order_number,order_type) VALUES(v_cname,v_ordered_date,v_order_number,v_order_type);
            COMMIT;
             fnd_file.put_line(fnd_file.output, 'Order Number is' || v_order_number);
             fnd_file.put_line(fnd_file.output, 'Order Type is'   || v_order_type);
       END;Script
    #!/bin/bash
    set -x
    export PARM5="$5" 
    export PARM6="$6"
    export PARM7="$7"
    sqlplus -s $1 <<EOF
    set head off feed off serverout on size 1000000
    exec abc('$PARM5','$PARM6','$PARM7');
    exit
    EOFNow when I run the 'XX Order Detail CSV Report' I get the below log and no Output
    +---------------------------------------------------------------------------+
    Application Object Library: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXKES_PDF_TRANSFER module: XX Order Detail CSV Report
    +---------------------------------------------------------------------------+
    Current system time is 06-MAY-2013 05:05:56
    +---------------------------------------------------------------------------+
    + export PARM5=66432
    + PARM5=66432
    + export PARM6=
    + PARM6=
    + export PARM7=Mixed
    + PARM7=Mixed
    + sqlplus -s APPS/APPS
    +---------------------------------------------------------------------------+
    Executing request completion options...
    Output file size:
    0
    +------------- 1) PRINT   -------------+
    Disabling requested Output Post Processing.  Nothing to process.  The output of the request is zero byte.
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed successfully
    Current system time is 06-MAY-2013 05:05:56
    +---------------------------------------------------------------------------+After the concurrent program executed I queried the table xxc_temp and here you see the data
    SQL> select * from xxc_temp;
    CUSTOMER_NAME
    ORDERED_D ORDER_NUMBER ORDER_TYPE
    A. C. Networks
    18-FEB-13        66432 MixedMy procedure fetches the data fro given set of i/p parameters but it doesn't give o/p coz it's a host based conc program.Please advise if there's a way to get the o/p in a host based conc program
    Thanks!!

  • Please help to call oracle procedure with out paramter from shell script

    Hi
    I want to call a process with out parameter from shell script. I am calling process in shell script in below way
    function Process_loads {
    ( echo 'set serveroutput on size 1000000 arraysize 1'
    echo "set pagesize 0 term on verify off feedback off echo off"
    echo "BEGIN"
    echo " dbms_output.put_line('Before Calling The package'); "
    echo " x ( '$1', '$2', '$2', '$4', '$5', '$error_code'); "
    echo " dbms_output.put_line('After Calling The package'); "
    echo "EXCEPTION "
    echo " WHEN OTHERS THEN "
    echo " dbms_output.put_line('BIN_LOAD_ERROR' || SQLERRM); "
    echo " ROLLBACK;"
    echo "END;"
    echo "/" ) | sqlplus -s $USER/$PASSWORD@$SID
    Here $error_code is out paramter. All varaibles passed in process are declared with export command.
    When executing .sh it gives below error
    "sh ERROR at line 3: ORA-06550: line 3, column 99: PLS-00363: expression '' cannot be used as an assignment target ORA-06550: line 3, column 3: PL/SQL: Statement ignored".
    Please help to get rid from this error or please suggest how to call a oracle procedure with out paramter from unix shell script.
    Thanks in advance

    You can try this:
    From sql*plus
    SQL> ed
      1  create or replace procedure my_proc(p_id in int, p_result out int)
      2  as
      3  begin
      4  select 10 * p_id
      5  into p_result
      6  from dual;
      7* end my_proc;
    SQL> /
    Procedure created.
    SQL> set serveroutput on
    SQL> declare
      2  v_r int;
      3  begin
      4  my_proc(10,v_r);
      5  dbms_output.put_line(v_r);
      6  end;
      7  /
    100
    PL/SQL procedure successfully completed.
    from bash:
    testproc.sh:
    #!/bin/bash
    (echo 'set serveroutput on';
    echo 'declare';
    echo 'v_r int;';
    echo 'begin';
    echo 'my_proc(10,v_r);';
    echo 'dbms_output.put_line(v_r);'
    echo 'end;';
    echo '/';) | sqlplus -s u1/u1
    Console:
    oracle@mob-ubuntu:~$ chmod u+x testproc.sh
    oracle@mob-ubuntu:~$ ./testproc.sh
    100
    PL/SQL procedure successfully completed.With kind regards
    Krystian Zieja

  • How to execute sql-queries through shell scripting in linux?

    How to execute sql-queries through shell scripting in linux?

    http://www.oracle.com/technology/pub/articles/saternos_scripting.html
    Two simple examples:
    #!/usr/bin/env bash
    set_orafra () {
       orafra=`echo 'set heading off
       select name from v$recovery_file_dest;
       exit' | sqlplus -s / as sysdba`
    set_orafra
    echo $orafra
    #!/usr/bin/env bash
    export ORACLE_SID=instance_name
    export ORACLE_HOME=/path_to_oracle_home_directory
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=/$ORACLE_HOME/bin/$PATH
    $ORACLE_HOME/bin/sqlplus -s <<EOF
    connect scott/tiger@my_instance_name
    INSERT INTO table VALUES (sysdate);
    exit
    EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM

  • Problem calling two perl modules from java in seperate threads(JVM CRASHES)

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

  • Passing parameters from shell script to OWB process flow

    Hi all,
    I am running OWB process flow (using the template script provided by oracle) and i want to pass two date parameters as shown below:
    sqlplus -s $SQL_USER/$SQL_PWD@$ORACLE_SID @$HOME_DIR/src/vmc_oem_exec_script.sql OWB_OWNER VMC_POST_DW_PF_LOC_SIT PROCESS VMC_NM1_PORT_MAIN "," "P_DATE_FROM=$DATE_FROM,P_DATE_TO=$DATE_TO"
    How do i catch those values in process flow and pass those to mappings in Process flow?
    Do i need to create PF variables with same names or any name will do?
    Thanks in advance

    This document is explaining how to pass data between activities in process flow.
    I am passing parameters from a shell script.
    Any ideas,how to pass parameters from shell script and then initialize the process flow variables based on those values and then pass them further to mappings.
    Thanks

  • Query v$ views from shell script fail

    Hi everybody,
    the query below is runing well with a SQL*PLUS (database is mounted and not open)
    SQL> SELECT member FROM v$logfile;
    MEMBER
    +DATA/testgfi/onlinelog/group_1.298.773871647
    +DATA/testgfi/onlinelog/group_2.294.773871647
    +DATA/testgfi/onlinelog/group_3.295.773871647
    But Giving error if I run it from Shell script ???
    $ sqlplus -s '/ as sysdba' << EOF
    SELECT member FROM v$logfile;
    EOFSELECT member FROM v
    ERROR at line 1:
    ORA-01219: database not open: queries allowed on fixed tables/views only..
    Please help..
    Thanks..
    Aljaro

    Aljaro wrote:
    Hi everybody,
    the query below is runing well with a SQL*PLUS (database is mounted and not open)
    SQL> SELECT member FROM v$logfile;
    MEMBER
    +DATA/testgfi/onlinelog/group_1.298.773871647
    +DATA/testgfi/onlinelog/group_2.294.773871647
    +DATA/testgfi/onlinelog/group_3.295.773871647
    But Giving error if I run it from Shell script ???
    $ sqlplus -s '/ as sysdba' << EOF
    SELECT member FROM v$logfile;
    modify as below
    SELECT member FROM v\$logfile;

  • Accept input from Shell script in sql*plus

    Hey! Guys..
    i need the following info.
    I am running a shell script from sql*plus. I need to accept a value from shell script into my .sql file.
    thanks..
    Harsh.

    prompt for input, pass to another shell
    # contract_status_prompt.sh
    read udate?"Enter week-ending date in format dd-mmm-yyyy: "
    contract_status_update.sh $udate >$FDWLOG/current/contractstatusupdate`date +%d%h%y`.log
    echo `date`
    # End contract_status_prompt.sh
    Read the variable passed and use in SQLPlus:
    # contract_status_update.sh
    echo "Running contract_status.sh"
    echo "create records for contract_status"
    echo `date`
    echo " "
    echo " date used is "; print $1
    echo " "
    sqlplus <<exit
    @$FDWSQL/sqlparms
    set time on
    prompt *** Set contract_status_period ***
    update contract_status_period
    set period_date = '$1';
    commit;
    exit
    etc.

  • Exports (from shell script) without password given explicitly in script

    Hi All,
    I have Oracle 10g2 on SLES 10 64-bit. I would like to do export the database using data pump from shell scripts. Is there any method to hide the password in the script file.
    Currently in doing by command:
    expdp system/password@database ....
    So any user who see the script will know the passowrd.
    Regards
    Groxy

    Hi,
    Have you considered the "Secure External Password Store" feature that was added in 10gR2? It uses the Oracle Wallet to store a database_alias with username/password credentials in encrypted format. Then you can enter your expdp command like this:
    expdp /@database_alias ...
    Take a look at the 10gR2 Security Guide. There's a chapter there on how to set this up.
    John

  • Calling a java code from shell script.

    Hi all,
    I want to access a method of java class from a unix shell script.basiacally I want to know how to access a java code from a shell scriptt.If anybody has any info on this , kindly revert back to me.
    Rgds,
    Satya

    Hi,
    Suppose I hv a main() method.
    Then how to access that class from Shell Script.
    Can u send me the piece os compiling and running process for it.
    Rgds,
    Satya

  • Initiating batch scripts from Maxl Script Editor in Admin Console??

    Guys,
    Is it possible to initiate batch scripts from Maxl script editor in Admin Console.
    I dont want to automate the scripts as my data loading process can happen at any time.
    Thanks in advance
    A

    Hi A,
    I'm not sure what you're asking? Do you want to run a batch of Maxl scripts, or a batch file, or a single Maxl Script? Why do you choose to use the Admin console to do this? Could you run what you're trying to run in batch from the command line?
    Executing MaxL and MDX Scripts
    To execute a MaxL script or an MDX script:
    Open or create the script.
    From the server drop-down list on the toolbar, select the Analytic Server to execute the script against.
    The drop-down list contains only Analytic Servers that are displayed in your Enterprise View. For more information about connections, see Connecting to Analytic Servers in MaxL and MDX Script Editors.
    Specify how errors should be handled during execution. See Setting MaxL and MDX Execution Options.
    Specify how you want results to be displayed in the Results tab. See Viewing MaxL and MDX Results.
    If the script contains variables, specify how undefined variables are resolved during execution. See Resolving Undefined Variables.
    To execute the entire script, right-click and select Execute from the pop-up menu.
    To execute only part of the script, highlight the statement or statements that you want to execute, right-click, and select Execute from the pop-up menu.
    The script executes against the specified Analytic Server, and the results are displayed in the Results panel.Regards,
    Robb Salzmann

  • Calling an expect script from another script (sh)

    How to call the EXPECT utility from SHELL script?
    Our objective is - We have developed a shell script to connect the oracle database and generate the XML file and this XML file needs to be transfer to another windows machine using the SFTP servcies. We are planning to schedule this job using the CRONTAB.
    Our first script 1:
    # connecting to oracle database and generating the file
    ORACLE_SID=TEST
    ORACLE_HOME=/u01/oratest/db/tech_st/11.1.0
    export ORACLE_SID ORACLE_HOME
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    PATH=$ORACLE_HOME/bin:$PATH
    output=`sqlplus -s /nolog <<EOT
    set pages 0 feed off
    whenever sqlerror exit failure;
    connect xgbzprod/xgbzprod
    exec XGBZ_GL_COA_XMLTAG_PROC;
    EOT
    `
    cd /u01/oratest/gebiz_processed
    for fn in GEBIZ_COA_RPO000*.*; do
    # using the EXPECT utility to transfer the generated file to antoher machine
    set timeout 10
    spawn $env(SHELL)
    match_max 100000
    send -- "sftp username@IP Address\r"
    expect -exact "[email protected]'s password:"
    send -- "Password\r"
    expect -exact "sftp>"
    send -- "cd /<SFTP location>\r"
    expect -exact "sftp>"
    send -- "lcd /<Local locatoin>\r"
    expect -exact "sftp>"
    send -- "bin\r"
    send -- "put $fn\r"
    expect -exact "sftp>"
    send -- "quit\r"
    send -- "exit\r"
    expect eof
    -- When we run the above script it failes and the script is not recognizing the other variables.
    -- We have split the procedure to keep the oracle connection in one script and another script for EXPECT utility. But we are lack of how to call the EXPECT utility in shell script.
    Please help us
    Thank
    Dhanraj Chilla

    You might want to try to better understand shell script programming. It makes it otherwise difficult for a poster to recommend you a solution. I don't believe you can expect others to do all the development and testing work for you. Since this is a forum on a volunteer basis, you might also want to consider marking helpful replies and review received answers more carefully.
    Perhaps the following will work for you:
    #!/bin/bash
    export ORACLE_SID=TEST
    export ORACLE_HOME=/u01/oratest/db/tech_st/11.1.0
    export ORACLE_SID ORACLE_HOME
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    export PATH=$ORACLE_HOME/bin:$PATH
    echo
    output=`sqlplus -s /nolog <<EOT
       set pages 0 feed off
       whenever sqlerror exit failure;
       connect xgbzprod/xgbzprod
       exec XGBZ_GL_COA_XMLTAG_PROC;
    EOT
    `
    echo "$output"
    username="oratest"
    hostname="11.10.11.159"
    password="welcome1"
    for fn in GEBIZ_COA_RPO000*.*; do
       echo "GL Chart of Accounts File Name : " $fn
    /sftp.exp "$username" "$hostname" "$password" "$fn"
    done
    #!/usr/bin/expect -f
    set username [lindex $argv 0]
    set hostname [lindex $argv 1]
    set password [lindex $argv 2]
    set fn [lindex $argv 3]
    spawn sftp $username@$hostname
    expect -exact "[email protected]'s password:"
    send -- "$password\r"
    expect -exact "sftp>"
    send -- "cd /sftp0002/uat/inbox\r"
    expect -exact "sftp>"
    send -- "lcd /u01/oratest/processed\r"
    expect -exact "sftp>"
    send -- "put $fn\r"
    expect -exact "sftp>"
    send -- "quit\r"
    send -- "exit\r"
    expect eofP.S. The above code is very simplistic and does not take error handling into account.
    Using CURL, like I suggested in my first reply was an easier solution, since you don't need to to script Expect, but it turns out that you might need Enterprise Linux 6 or install at least CURL verison 7.19 to support sftp.

  • Call Photoshop script from Indesign script CS4 JS

    Hi, I open Photoshop linked file from InDesign in Photoshop and I need same InDesign script to run Photoshop script on the file. How I can call the Photoshop script from InDesign script.
    Thank you very much for your help.
    Yulia

    Thank you, Kasyan.
    800 lines of script is little be intimidating.
    What we are trying to achieve is to open jpgs in Photoshop and resave them as tiffs and replace same jpg with corresponding tiff in Indesign as it was placed before.
    Is there a way to call Photoshop from Indesign through appleScript.
    I have most of the script done for Indesign and I have Photoshop shript ready that saves jpgs as tiffs done. I am only missing the part where I can call this existing Ph. script from Indisign.
    We prefer not to use BridgeTalk if possible, because we have a lot of programs open and running in the same time, and would like to avoid to open one more program (BridgeTalk).
    Thank you very much for your great help.
    Yulia

Maybe you are looking for

  • How do I get rid of home page I do not want

    I have always had Google as my Home Page on Firefox. Suddenly out of nowhere (and I have never used this site) it comes up with a website for a Canadian drugs company. Try as I may I cannot get rid of this website. I have done all the normal things l

  • F-22 Automatic Payment Transaction ( Payment Method )

    Hi we are not using Automatic payment transaction ( from customer ).  and not want to use it. Only for reporting purpose we are intended to use field (Lov)  Payment Method ( like cash, bank , DD etc ).  field. in transaction Incoming payment ( F-22)

  • Generate archive logs are not in sequence number?

    On last friday... the latest archive log number was ARC00024.ARC. Tomorrow when I come backup, the archive logs ARC00001.ARC and ARC00002.ARC were being generated by oracle itself. I wondering the archive log sequence should be in sequence. What is h

  • Address Book does not show prefixes or suffixes.

    Looking at list of contacts in column view only shows first/last names.  Contacts on iPhone do show prefixes and suffixes.  Does anyone know a workaround to change this behavior?

  • Display Chinese Language

    In the struts-config.xml I set <message-resources parameter="test.view.TestResources_zh_cn"/> The TestResources_zh_cn.properties file contains the Chinese characters for the keys. Next I go to the Internet Explorer to set the language to Chinese[zh-c