Shell Script parameter $0 displays all concatanates all defalut parameter values

I have a issue.The $0 is displaying all the default parm values. Pls suggest workaround:
echo ‘Printing parameters….’
echo ‘0:’$0
echo ‘1:’$1
echo ‘2:’$2
echo ‘3:’$3
echo ‘4:’$4
echo ‘5:’$5
echo ‘FCPLOGIN:’$FCP_LOGIN
echo ‘Finished printing parameters.’
echo ‘FCP_USERID:’$FCP_USERID
Printing parameters….
0:/u01/app/oracle/DEV/apps/apps_st/appl/xxabc/12.0.0/bin/xxabc
1:xxabc FCP_REQID=684095 FCP_LOGIN=”APPS/APPS” FCP_USERID=1234 FCP_USERNAME=”ABC” FCP_PRINTER=”noprint” FCP_SAVE_OUT=Y FCP_NUM_COPIES=0
2:
3:
4:
5:
FCPLOGIN:APPS/SONICDEV1
Finished printing parameters.
FCP_USERID:

How do you call it ?
What character(s) do you use to suppress the " in the parameters specified ?
If you call it like this (simplified) :
program "one two three"
it will do:
$0=program
$1=one two three

Similar Messages

  • In Automator, how can I pass a shell script output to Display Notification?

    In Automator, how can I pass a Run shell script output to Display Notification?

    Soemthing like this will work

  • JSP Shell Script Output (All At Once Vs Line By Line)

    I have no problem calling a shell script and then displaying that output on a web page.
    However, I would like to display the output as the script executes (I want to print the output line by line as it happens), rather than waiting for the script to completely finish and then display the whole output all at once. The script checks a large database and takes about 10 minutes to run. I don't want to stare at a blank screen during that time, but of course want to watch it's progress on the display (when I run the script directly I print out status to the screen).
    Can someone point me in the right direction on how to do this?
    -jsaspo

    Bump...
    Anyone?

  • How to write CLOB parameter in a file or XML using shell script?

    I executed a oracle stored procedure using shell script. How can i get the OUT parameter of the procedure(CLOB) and write it in a file or XML in UNIX environment using shell script?
    Edit/Delete Message

    SQL> var c clob
    SQL>
    SQL> begin
      2          select
      3                  DBMS_XMLGEN.getXML(
      4                          'select rownum, object_type, object_name from user_objects where rownum <= 5'
      5                  ) into :c
      6          from    dual;
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> set long 999999
    SQL> set heading off
    SQL> set pages 0
    SQL> set feedback off
    SQL> set termout off
    SQL> set trimspool on
    // following in the script is not echo'ed to screen
    set echo off
    spool /tmp/x.xml
    select :c from dual;
    spool off
    SQL>
    SQL> --// file size
    SQL> !ls -l /tmp/x.xml
    -rw-rw-r-- 1 billy billy 583 2011-12-22 13:35 /tmp/x.xml
    SQL> --// file content
    SQL> !cat /tmp/x.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <ROWNUM>1</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>BONUS</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>2</ROWNUM>
      <OBJECT_TYPE>PROCEDURE</OBJECT_TYPE>
      <OBJECT_NAME>CLOSEREFCURSOR</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>3</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>DEPT</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>4</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>EMP</OBJECT_NAME>
    </ROW>
    <ROW>
      <ROWNUM>5</ROWNUM>
      <OBJECT_TYPE>TABLE</OBJECT_TYPE>
      <OBJECT_NAME>EMPTAB</OBJECT_NAME>
    </ROW>
    </ROWSET>
    SQL>

  • Unable to pass parameter in oracle procedure through unix shell script

    Hi Experts,
    I have oracle procedure where in I have to pass the value of procedure parameter through unix script.
    Follwoing is the sample procedure which i tried to exceute from the unix.
    Procedure:
    create or replace procedure OWNER.PRC_TESTING_OWNER(OWNER IN VARCHAR2) AS
    sql_stmt varchar2(1000) := NULL;
    v_count number := 0;
    v_owner varchar2(100) := owner;
    begin
    sql_stmt:='select count(1) from '||v_owner||'.EMP@infodb where rownum<=10';
    execute immediate sql_stmt into v_count;
    DBMS_OUTPUT.PUT_LINE(sql_stmt);
    DBMS_OUTPUT.PUT_LINE(v_count);
    END;The script which I used is:
    Unix
    #!/bin/ksh
    parm=$1
    echo start
    sqlplus -s scott@DEV/tiger <<EOF >>result_1.txt
    set serveroutput on;
    select '$parm' from dual;
    exec owner.PRC_TESTING_OWNER('$parm');
    EOFThe script is working fine that is i am able to pass to parameter value through unix shell script. :)
    But if I want to pass the value of the owner in cursor , I am unable to pass this value through unix.
    Following the procedure which i am trying to implement.
    create or replace procedure OWNER.PRC_TESTING_OWNER(OWNER IN VARCHAR2) IS
    v_owner varchar2(100) := owner;
    CURSOR main_cur IS 
      select
      i.ROWID  rid ,
      emp_name,
      deptid
      from v_owner.employee;
    CURSOR subset_cur(c_deptid NUMBER ) IS
        SELECT *
          FROM v_owner.DEPT d
          where  d.dept_id=c_deptid;
    --##main loop     
    FOR i IN main_cur LOOP
          FOR j IN subset_cur(i.deptid) LOOP     
    BEGIN
    insert into v_owner.RESULT_TABLE
    END;
    END LOOP;
    END LOOP;How can i pass parameter value of the stored procedure through unix script(that is "owner" in this case), when these parameter value is
    used in cursor? :(
    Can anybody help me regarding the same?
    Thanks in Advance !! :D

    It's not the parameter in the cursor that is the problem, it's that you are trying to use static SQL for something that won't be known until run time (the owner of the table).
    You would need to use something like ...
    declare
       l_owner        varchar2(30) := 'SCOTT';
       l_ref_cursor   sys_refcursor;  
       type l_ename_tab is table of scott.emp.ename%type;
       l_ename_array  l_ename_tab;
    begin
       open l_ref_cursor for
          'select ename
          from ' || l_owner || '.emp';
       loop
          fetch l_ref_cursor bulk collect into l_ename_array limit 10;
          exit when l_ename_array.COUNT = 0;
          for x in 1 .. l_ename_array.count
          loop
             dbms_output.put_line(l_ename_array(x));
          end loop;
       end loop;
       close l_ref_cursor;
    end;
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01

  • How to exec. stored procedure having out parameter value in shell script ?

    Hi Gurus,
    I am writing a shell script which is calling a SP having out parameter as varchar2.
    So how can i do this in shell scripting ? (I am a new in shell scripting)
    a simple example is preferred.
    Thanks
    Sandy

    So how can i do this in shell scripting ? Assuming you want to assign the out parameter value to a shell variable, here's a small example :
    SQL> select ename from emp where empno=7902;
    ENAME
    FORD
    SQL> create or replace procedure show_name (
      2     v_empno in number,
      3     v_ename out varchar2)
      4  is
      5  begin
      6     select ename into v_ename from emp
      7     where empno = v_empno;
      8  end;
    SQL> /
    Procedure created.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    $ cat show_name.sh
    ENAME=`sqlplus -s test/test << EOF
    set pages 0
    set feed off
    var V1 varchar2(30);
    exec show_name($1, :V1);
    print V1
    exit
    EOF`
    echo $ENAME
    $ ./show_name.sh 7902
    FORD
    $

  • Running shell scripts from within oracle. A big task is forgotten

    Dear List,
    I have some shell shell scripts which do some tasks on the linux OS level.
    I am calling the Korn scripts using a java class, which in turn is being called from a PLSQL function.
    All but one of the 10 script works fine. This is the script which does the most work, and takes on average 40 minutes usually.
    Why does Oracle forget the running of the shell script? I wait in my PLSQL function for the return code, but it never comes. The scripts I have not written myself !
    I look forward to your reply on this matter.
    regards
    Ben

    Hi
    If you are using the Oracle database 10g, the new dbms_scheduler package allows you to run shell scripts. The dbms_scheduler.create_job procedure have one parameter called the job_action in which you specify the full path of the shell script.
    I hope this will help

  • How to submit "active users" standard report using shell scripting

    Hi All,
    Greetings.
    I want to submit the "Active Users" standard report in Sysadmin responsibility using a shell script.
    I also want to pass a parameter named email to this..
    can anyone help me do this?
    Thanks in Advance,
    Bhaskar

    Hi Bhaskar,
    You can achieve this by shell scripting either by scripting via CONCSUB utility (invoked from OS) or you can use the FND_SUBMIT package (through PL/SQL package), and in the script itself you can create the outputs or any hardcode messages to a file, and then mail the output to your desired mail address.
    If you use mail or mailx command using the OS utility then you can even send mail to external users which should not necessarily be a registered EBS users.
    Google, Forum Search and metalink will provide you loads of articles on how to use CONCSUB and FND_SUBMIT packages.
    Thanks &
    Best Regards,

  • Web Service to call Power Shell Script

    Hello All,
    How can we make a call to power shell script from a asp.net web service with parameter ?
    Thanks in Advance

    Normally you can do everything using web service, why do you want to call powershell
    May be you can plan 
    http://geekswithblogs.net/Norgean/archive/2012/09/19/running-powershell-from-within-sharepoint.aspx
    Plan to use workflow for same
    http://ilovesharepoint.codeplex.com/wikipage?title=Execute%20PowerShell%20Script%20Action
    Also check 
    http://forums.iis.net/t/1161083.aspx?running+PS+scripts+from+a+webpage+sharepoint+site
    If this helped you resolve your issue, please mark it Answered

  • Please help me remove the last elements of shell script from my applescript

    I read somewhere that running a shell script in an applescript was inefficient and created extra overhead, fine, so I am trying to take all of my shell script out of my applescript (this should fix issues with forward slashes in names as well...)
    however I am stuck on these last two lines (I know they are probably trivial but I've been up waaaay too long now) so I was wondering if anyone would be awesome enough to show me how to convert the bash to applescript.
    --does a recursive copy and rename
    do shell script "cp -R " & (thePath as text) & " " & (theOtherPathWithFile as text)
    --does a copy and rename, then a simple move
    do shell script "cp " & (quoted form of (POSIX path of this_item as text)) & " " & (theNewPath as text) & "&& mv " & (theOtherPathWithFile as text) & " ~/Desktop"
    Any and all help will be appreciated.

    There isn't anything wrong with using shell scripts, especially since AppleScript is designed to do this very thing. There is some overhead when using do shell script, just as there is some overhead when using an application tell statement, so it just depends on what you are doing.
    The performance of any particular script would also be up to whatever is acceptable to you (or your customers), and sometimes a shell script is the most efficient way to do something. Many of the system utilities are just GUI front-ends to a shell script, so they can't be all bad.
    To do your file copy or move with the Finder, you will need to tell it to duplicate or move the item(s) (there is that pesky overhead again). Shell scripts use POSIX paths while the Finder uses colons as its path delimiter, so you will need to use the correct file path references - there is a decent article about that at Satimage. Once your file paths have been defined (or using something like choose file or choose folder)), your script would be something like:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    tell application "Finder"
    duplicate source to destination
    -- move source to destination
    end tell
    </pre>
    See the Finder and *System Events* scripting dictionaries for more information about the ways they deal with files.

  • Shell script bafflement

    I recently downloaded a shell script that runs an embedded python script.
    The first few lines looks like this:
    <pre>
    #!/bin/sh
    exec python $0 ${1+"$@"}
    </pre>
    I know what #!/bin/sh does, and I know what "exec python" does, but what do the
    <pre>
    </pre>
    and
    <pre>
    $0 ${1+"$@"}
    </pre>
    mean???
    (The actual python script follows these lines.) I assume the gist of it is that it runs sh, captures any command line arguments given after the name of the shell script executable, and then turns this all over to python as if the python code that follows had been invoked from the command line with those arguments following.
    But I'd like to understand it on the level of the actual syntax....

    Daniel's post explains almost everything; I just want to add some minor points (and one question).
    For /bin/sh, the first line
    is equivalent to
    which is do-nothing built-in command of sh.
    (If the first line is
    or
    then sh will try to find a command "" and results in 'command not found'.)
    Then the second line is executed by sh, and the process is replaced by python. The third line
    is illegal (or incomplete) as a shell script, but it's not a problem because sh does not read the line.
    Now python reads the script from the beginning again.
    In python, """ starts a multi-line string. The string starts just after """, so the string is
    :"<newline>exec python $0 ${1+"$@"}
    This is not a comment for python, but python ignores any simple expression in a script anyway. For example
    #!/usr/bin/python
    a = "foo"
    a
    "bar"
    is a legal python script. The second and third lines (a and "bar") are simple expressions and do nothing.
    One of the reason for using this trick is portability. The main problem is that python may be installed in /usr/bin, /usr/local/bin, /sw/bin, or anywhere else, depending on the system. So if a python script starts with
    #!/usr/bin/python
    then it does not run if python is installed in other places. A trick often used is
    #!/usr/bin/env python
    which will search python in the user's PATH. But this trick works only if /usr/bin/env exists.
    Now a (minor) question:
    What is the difference between ${1+"$@"} and "$@"? The former is more portable than the latter? If so, why?
    /bin/sh may be a pure (true) Bourne-shell, bash or ksh (or any other?) depending on the system. I tried both bash and ksh, but ${1+"$@"} and "$@" seem to give the same results.
    PowerMac G4   Mac OS X (10.4.5)  

  • Execute Shell Script from OWB Process Flow

    I am trying to execute a Shell Script from a User Defined activity of OWB Process Flow. As I have not done such things earlier
    I need to know:
    1. Where I will put the Shell Script (move_file.sh)?
    2. What are the values in need to enter in the external process parameters (such as Command, Script, Result Code, Parameter List, Sucess Threshold etc)
    Please reply this thread. It would be a big help for me and probably for others as well.
    Kind Regards
    Zakir
    Message was edited by:
    Zakir

    Check this out,.
    http://download-uk.oracle.com/docs/cd/B31080_01/doc/owb.102/b28223/ref_processflows.htm#i1173362
    And answer to your question1, the shell script should be on the unix server.
    Regards

  • Automator/Applescript not running shell script properly

    I can open Terminal, and this command works:
    lame -h --abr 256 /Users/myhome/Desktop/Some\ Wav\ File.wav /Users/myhome/Desktop/TheMP3.mp3
    But when I try to run the same command in applescript from Automator, it fails.
    set sourceFile to quoted form of POSIX path of "/Users/myhome/Desktop/Some Wav File.wav"
    set mp3File to quoted form of POSIX path of "/Users/myhome/Desktop/TheMP3.mp3"
    set command to "lame -h --abr 256 " & sourceFile & " " & mp3File
    display dialog command
    do shell script command
    The display dialog outputs:
    lame -h --abr 256 '/Users/myhome/Desktop/Some Wav File.wav' '/Users/myhome/Desktop/TheMP3.mp3'
    Which, as little as I know of applescript, is how applescript handles spaces in filesnames. Can anyone please help?

    You need *do shell script* attribute described in the 10.4 Changes section of http://developer.apple.com/mac/library/releasenotes/AppleScript/RN-AppleScript/R N-104/RN-10_4.html#//appleref/doc/uid/TP40000982-CH104-SW1 Additional info can be gained by posting to the AppleScript and Unix forums under OS X Technologies.

  • Executing java from unix shell script

    Hi, I am trying to execute java program from a unix shell script and the program has a command line parameter. I have tried in ways like
    /opt/java1.4/bin/java CollExtractLoadProcess /home/inbox/archive/file_name
    /opt/java1.4/bin/java CollExtractLoadProcess "/home/inbox/archive/file_name"
    /opt/java1.4/bin/java CollExtractLoadProcess '/home/inbox/archive/file_name'
    /opt/java1.4/bin/java CollExtractLoadProcess file_name
    No matter how I execute it gives me the following error
    Exception in thread "main" java.lang.ClassFormatError: CollExtractLoadProcess (C
    ode segment has wrong length)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    Could someone please let me know what is the correct way of doing this?
    Thanks.

    Sounds like you either have a corrupt class file or you're using an older version of the JVM to try to execute classe that were compiled for a newer version.

  • Running shell scripts from GUI

    I'm trying to run a simple shell script (bash or sh) from the GUI (just double click it).
    I've managed to run it by double clicking, BUT, it runs from my home directory (even if i add --noprofile or remove #!/bin/bash line completely).
    How can I keep the current directory, or at least get it as a variable?
    Thanks,

    Hi
    If you are using the Oracle database 10g, the new dbms_scheduler package allows you to run shell scripts. The dbms_scheduler.create_job procedure have one parameter called the job_action in which you specify the full path of the shell script.
    I hope this will help

Maybe you are looking for

  • Solution Manager 4.0(Installation)

    Hallo Everyone, I'am trying for about four hours to install Solution Manager 4.0. Without any progess. I only reach Step 2 "Define Parameters, Media Browser > Software package" At the End, I got this error and the Installation was aborded. ERROR     

  • How to shade alternate rows in deski

    Hi all, I am new to business objects. I have a requirement from the client that I need to differentiate the alternate rows by different shadings. Can anyone help me out. Thanks & Regards, BO

  • Tutorials updated for the new version of LabHSM, a toolkit for advanced event-driven development

    We are glad to announce that the excellent tutorials Mr. Paul F, Sullivan (SULLutions.com) writes for us have been revised and updated in the light of the changes introduced in version 1.1. Please feel free to check them out at our site (http://labhs

  • Transaction to manage documents without the use of RSA1

    Hello, We want to create a transaction to create documents in BW. This is available under RSA1 - Documents. But now users can enter the administrator workbench. And that is what we don't want. Is there a transaction for this screen? Or is it possible

  • New Business

    I am opening a small business and would like to start establishing credit for the business. Does anyone know if the business credit cards will check the individuals personal score before giving them credit?