Debugging a program being called from a shell script

hi All,
i want to know how debug a C program being called from A Shell Script,
my script looks like the following :
ecReqProcMain $Cfg/ecReq.g $TotCnt 2>> $ErrFilei also have to pass some arguments to the script itsellft, which in trun going to pass it to the program,
also in some cases i may be required to Pipe some data to the program, like the folowing
cat DataFile | myProgramThanks ,

You can also use ss_attach with the scheme that Anton
suggested above. Instead of inserting "dbx" into your
script, insert "ss_attach" into your script.
It's also possible to change your script to something like this:
cat DataFile | ${DEBUG} myProgram
Then you can run your script like this:
setenv DEBUG ss_attach
ecReqProcMain $Cfg/ecReq.g $TotCnt 2>> $ErrFile
--chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How can i debug a rfc being called from sap

    hello Gurus,
    We made a RFC call from SAP r3 to sap grc nfe......we did not receive any data in sap grc .......we go to SM58 and there it gives
    the message "Name or password is incorrect (repeat logon)u201D.
    How can i find out where the data has stuck.
    Please help.
    BR
    Honey

    HI,
    please have a look at the link below..
    this may help u !!!
    [Re: how can i debug a rfc being called from .net connector (NCO) v2.0?;
    Best of Luck !!1
    Regards
    Ravi

  • Sqlplus called from a shell script

    Hi.
    I'm calling to sqlplus from shell script. The thing is that when it ends its execution I am in sqlplus console, but I want to be in my script. Is there any option to auto-exit when it ends?
    sqlplus $DB_CON @$SQLDIR/$SQLFILE
    Thanks
    Rodrigo

    You just have to add exit command at the end of the script file, after the slash:
    end;
    exit;
    and that should work.

  • Error when running the OWB process flow from the shell script

    Hi,
    I am able to deploy the process flow succesfully but when I execute the process flow from the shell script,I am getting the following error.Previously it worked fine.
    I had to make some chnage in the IP address,so i had to deploy again.
    Connected.
    SQL> @/oracle/product/owb92028/owb/rtp/sql/oem_exec_template.sql OWB_RTR LOC_P_REL PROCESS P_W_SOURCE "," ","
    Elapsed: 00:00:00.00
    Elapsed: 00:00:00.01
    Stage 1: Decoding Parameters
    | location_name=LOC_P_REL
    | task_type=ProcessFlow
    | task_name=P_W_SOURCE
    Stage 2: Opening Task
    declare
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 17
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 137
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 164
    ORA-06512: at line 205
    Thanks in advance.
    Vinay

    Hi Kamal and kanakam kolla,
    This is just to let you know that,I solved my problem little differently by creating a new location and deployed the process flow.Now my process flow is working fine when i call from the shell script.What i see is that, it does not update properly when we update and redeploy the process flow.So far this is the work arround i could think off and i succesfully tested this.
    Thank you Kamal and kanakam kolla,for giving a thought towards my problem.
    Thanks
    Vinay

  • Calling an external shell script program from ABAP.

    Hi,
      Can i call an external shell script program from abap which is there on application server.
    The FM WS_EXECUTE i know can be used for calling this purpose.
    But i am getting a doubt that how can i call the external program from there.
    Please clear my doubts.
    Thanks in advance.
    Vikash

    search in SCN for sm49 and sm69 Tr. you will surely find solutions for it, with a simple search.

  • Getting an exit value from a program called thru a shell script

    how do i get the correct exit value always from a program called thru a shell script
    the getExitValue of the process works fine someitmes but not always ...
    Ex: write a pgm which sleeps for 5 secs & returns with exit(100).try to invoke this thru a script & try to run this script from Runtime.getRuntime.exec(..)
    ...the exit value is not same as 100.(it works if the sleep is not given though !!)
    can nebody help??

    ive done that ...see the sample code for ex..
    public void execute()
                   try{
                             Process program=Runtime.getRuntime().exec(cmd);
                             printOutput(program.getInputStream());
                             try
                                  program.waitFor();
                             catch(InterruptedException e)
                                  System.out.println("Command Interrupted: " + e);
              System.out.println("Error status : "+program.exitValue());
                        catch(SecurityException e)
                             System.out.println("Error executing program "+e);
                        catch(IOException e)
                             System.out.println("Error executing program "+e);
    ....

  • Calling linux / unix shell scripts from APEX

    Hi -- I'm doing some prototyping, and would like to try calling a unix shell script on the server from within APEX.
    Is this possible? Maybe thru Javascript? Other ways? Not sure if it's possible thru pl/sql.
    FYI, I'm attempting to check username/password specified at login to see if it's a valid login
    to another database (also specified at login). If there's an easier way to do this, I'd love to hear it!
    We're highly motivated to have a single apex app work on multiple databases -- largely because of a lack of
    administration resources on the other databases. All databases are accessible via database links from
    the apex server (the links are necessary to implement other business rules), and I know I can get
    the DML working. Powers that be prefer that Database Account authentication (or a facsimile thereof)
    be used. I suspect I'm opening myself up to lots of criticism by disclosing this ... :)
    Thanks for any ideas,
    Carol

    R -- If I understand you correctly, a pl/sql process in APEX could invoke a java program on the server. Is that correct?
    If so, is there any reason it couldn't just call a unix shell script? Seems they're both just executables recognized by the OS....
    I know I called unix scripts from embedded sql a billion years ago, but don't recall the method for doing that. What is
    the syntax I'd use in apex / pl/sql?
    thanks,
    Carol

  • Call a UNIX shell script from an oracle stored procedure

    We need to call a UNIX shell script from an oracle stored procedure
    i.e. the control should come back to the procedure once the script completes. Can any body help to achieve this ?

    There are various ways in achieving this.
    For Example, you can call a PRO*C-Library residing on the database server.
    This requires a PL/SQL library to be generated and some changes to the Listener configuration.
    It is also possible to implement a java procedure on the database being invoked by a PL/SQL wrapper class.
    In this way (and if used right) there is also granularity regarding the filestructure permissions given and it may be called during a Forms or other PL/SQL session.
    The article below explains a more generic approach how to invoke shell commands from within an Oracle Instance.
    Be careful with this, because it really works ;)
    Refer to :
    http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php
    Message was edited by:
    user434854

  • Naren - I don't see MB_POST_DOCUMENT being called from MIGO

    naren  -
    I put a breakpoint on the call statement here:
      CALL CUSTOMER-FUNCTION '001'
           TABLES  XMKPF = ZMKPF
                   XMSEG = ZMSEG
                  XVM07M = ZVM07M.
    But when I hit post in MIGO, it doesn't stop at this breakpoint.
    Are you sure MIGO goods receipt posting calls MB_POST_DOCUMENT ???
    If so, what am I doing wrong ?
    Shouldn't this breakpoint catch the flow if MB_POST_DOCUMENT is being called from MIGO ???
    Thanks again ...
    djh-

    Hi,
    Enter all the data in MIGO..
    Before pressing the save button..
    Put /h in the command field..
    When you go to the debugging mode..
    In the menu choose...SETTINGS -> UPDATE DEBUGGING..
    Now you will get a message..Update debugging is switched on..
    Press F8..
    The debugging will be opened in an other session..
    It will call all the update modules one by one..
    Continue till MB_POST_DOCUMENT FM is called..
    Update debugging is required for debugging UPDATE FMs.
    Thanks,
    Naren

  • Calling a report from unix shell script

    Hi,
    I had to call a report from unix shell script.
    May i know the procedure to accomplish this
    Thanks in Advance
    A.Gopal

    First you should not include the whole path to your report in the call ...
    Use like this:
    /ora/u01/oracle/v101/as2/bin/rwrun.sh report=an_stati destype=file desname=/ora/u01/oracle/v101/as2/test.pdf desformat=pdf
    In $ORACLE_HOME/bin/reports.sh:
    1) Verify that you have updated the REPORTS_PATH variable to include your folder where you have the report in question
    REPORTS_PATH=/ora/u20/app/qits/env1/run:$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo: ....
    2) Verify that the REPORTS_TMP variable is pointing to a valid location and that the oracle user has access to write on it.
    After that, post the content of the tracefile located at $ORACLE_HOME/reports/logs/{in-process report server name folder}/rwserver.trc
    If no file is present then it means that you need to enable trace in your reports's conf file.... go to the $ORACLE_HOME/reports/conf folder and and locate the .conf file that correspond to your in-process reports server name (as specified in the rwservelet.properties file)... open/edit the file to enable trace logs ..
    i.e.
    Change the following line:
    <!--trace traceOpts="trace_all"/-->
    to <trace traceOpts="trace_all"/>
    Bounce the reports server and try to run the report again, this time the .trc file should be generated, post the content so that we can take a look.

  • Calling stored procedure from unix shell script

    Hello,
    I am facing a problem while calling a stored procedure from UNIX shell script. I want to return a output variable from the stored procedure to the UNIX environment.
    Here is the code-
    #!/bin/sh
    OUTPUT=`sqlplus cmag/magnum@dw <<ENDOFSQL
    set serveroutput on;
    var prd_out varchar2(100);
    exec create_pm_window(:prd_out);
    exit;
    ENDOFSQL`
    echo " output is - $OUTPUT"
    The problem is :prd_out is not getting copied to shell variable OUTPUT.
    I have a dbms_output.put_line in the stored proc create_pm_window and I can see that prd_out is getting populated.
    Any help is really appreciated.
    Thanks'
    Rakhee

    First step :
    make sure the PL/SQL works as expected.
    Does the following display the expected output executed from SQL*Plus ?
    set serverout on
    declare
    prd_out varchar2(100);
    begin
    create_pm_window(prd_out);
    dbms_output.put_line('output is '||prd_out);
    end;
    I don't have your procedure, but using a dummy procedure like :
    Scott@my10g SQL>create procedure foo(p_out in out varchar2)   
      2  is
      3  begin
      4  select 'Hello '||instance_name into p_out from v$instance;
      5  end;
      6  /
    Procedure created. and a toto.sh script as :OUTPUT=`sqlplus -s scott/tiger <<EOF
    set pages 0 lines 120 trimout on trimspool on tab off echo off verify off feed off serverout on
    var mavar varchar2(100);
    exec foo(:mavar);
    print mavar;
    exit;
    EOF`
    echo "OUT = ${OUTPUT}"
    exitIt works fine :[oracle@Nicosa-oel ~]$ ./toto.sh
    OUT = Hello my10g

  • Query To Locate Action Variable Being Called From

    we have this "M011 - 0" action variable that resets the value back to 0. i can't seems to find where this action variable is being called from the tidal. i looked at every places and failed to locate it. does anyone have a SQL query to find where this piece of info can be located?
    thank you,
    warren

    Try the Query that joins events and actions to find your event... then you can do a similar query to find jobs
    Marc
    SELECT dbo.tskmst.tskmst_name AS [Action Name], dbo.trgmst.trgmst_name AS [Event Name]
    FROM dbo.trgmst INNER JOIN
    dbo.trgtsk ON dbo.trgmst.trgmst_id = dbo.trgtsk.trgmst_id RIGHT OUTER JOIN
    dbo.tskmst ON dbo.trgtsk.tskmst_id = dbo.tskmst.tskmst_id
    WHERE (dbo.tskmst.tskmst_name LIKE '%M011%')

  • Passing Multiple Parameters to SQL Script from a Shell Script

    Hi Friends,
    I have SQL script which accepts 6 parameters.
    I am calling this from a shell script as shown below:
    sqlplus -s  ${ORACLE_ID} @${SQLPATH}KORONT_041.sql ${USER_ID} ${PDC} ${item_number} ${KORDC} ${PDCSET} ${last_Updated_in_hours} Out of the six parameters, item_number is not a mandatory parameter.
    When i pass all six parameters, there is no issue.
    But when i leave item_number blank, i am getting the below error
    Enter value for 6:
    User requested Interrupt or EOF detected.Based on the error, it seems that the NULL values for item_number is ignored and SQL*PLUS is waiting for one more input from user.
    How can i overcome this issue?
    Regards,
    Sreekanth

    Hi,
    I am calling the shell script from concurrent program and below is the log file of the concurrent program.
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    KORONT_041_SH module: KORONT - Daily Item Master Update
    +---------------------------------------------------------------------------+
    Current system time is 29-JUN-2011 10:09:35
    +---------------------------------------------------------------------------+
    REQUEST_ID: 68510795
    USER_ID: 4219
    PDC:    85
    Item Number:
    KORDC:    124
    PDCSET:   1100000003
    last_updated_in_hours: 24
    EMAIL_ID: [email protected],[email protected]
    SQLPATH: /e381/oracle/asodev01appl/custom/motont/1.0.0/sql/
    RPTDIR:  /e381/oracle/asodev01comn/admin/out/ASODEV01_asoprdb2
    RPTFILE: o68510795.out
    Table truncated.
    *Enter value for 6: User requested Interrupt or EOF detected.*
    Table truncated.
    old  15:       AND ic.organization_id   = &&4
    new  15:       AND ic.organization_id   = 1100000003
    0 rows created.
    Input truncated to 9 characters
    old   8:                AND organization_id   = &&4
    new   8:                AND organization_id   = 1100000003
    0 rows created.
    End of SQL
    No record.
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PRINT   -------------+
    Printing output file.
                   Request ID : 68510795      
             Number of copies : 0      
                      Printer : noprint
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed successfully
    Current system time is 29-JUN-2011 10:09:38
    +---------------------------------------------------------------------------+Regards,
    Sreekanth

  • Passing parameters to query called through a shell script

    I have a file called getInfo.sql that contains a query like:
    spool ./myInfo.txt
    select *
    from myTable
    where col1 = '&val1'
    and col2 = '&val2';
    spool off
    I would like to call SQLPLUS from a shell script and pass this file in as a parameter. How would I pass in the values for
    &val1 and &val2 ?
    Any help would be appreciated.
    Thanks
    Rajan

    Yes, you put a line in the script that looks like this:java classname parameter1 parameter2 parameter3 ...Then the JVM will call the static main(String[] args) method of "classname" and put those parameters into the "args" array.
    If you are asking how to generate such a script, or how to call it from your COBOL program, sorry, I don't know how to do that.

  • Is it possible to pass a variable from a shell script back to an Automator action?

    Is it possible to pass a variable from a shell script back to an Automator action?
    For instance, if I assign a value of foo to $var1 in my shell script how would I retrieve/pass that value in the next Automator action. I see that there is a variable called "Shell Script" but I can't any information on how to use it. 

    red_menace,
    Thanks but I still don't understand how to pass a single value that was set in the UNIX scipt back to Automator has a variable. Take the example below, I write 4 varables to STDOUT and all 4 are stored in a variable named "storage".  How do I assign 1 of these values to the Automator "storage" variable? For instance if I wanted to assign the value of $var2 to "storage" , how would I do that?

Maybe you are looking for

  • Snow leopard on IMac late 2006?

    Hi guys i have a imac 1.83 ghz intel core 2 duo 17 inch.I'm wondering if i could install the latest OS on it.Is it possible?

  • Problem with slide block puzzle

    Hello: I am doing a project that solve slide-block puzzles. My program take two common line arguments. One is a file specifying the initial configuration while the other specify goal configuration. My idea is to use an arrayList<block > to represent

  • HT4437 I have sound but no picture using my Apple TV

    I am trying to watch sky sports from my iPad using the Apple TV, I have sound but no picture?

  • Monitor Calibration Issue?

    When I'm in Develop or Print the brightness and color of a harbor that I photographed look just fine. They also look fine when I call up the printer's print preview window. However, when I print out the  photo, the blue water in the shadows takes on

  • Loadmovie sizing problems

    when I cal the swf's I place them into a movie clip that's the same size (pixel X pixel) as the blank movie clip I'm using. When they get called into the clip though, they go full size, it's rather strange. I need to know how to keep them at their or