I need a shell script code

hi,
Anybody can give me a code of shell script..
i am new to shell script.
i have a pl sql procedure
1. it runs everyday at a particlar time
2. i need to send an email to 3 managers.
3. email message contains the query output of the table that is updated
can anybody help
thanks

<ul><li>What shell are you using? Try "echo $SHELL" from your Linux prompt.</li>
<ul><li>If the answer is Bash, have you done any homework on Bash Scripting at all?
<ul><li>(If the answer is "no", please refer to the above link for information on how to script in Bash, phrased much more clearly than I ever could alone.)</li></ul></li>
<li>Ditto Csh</li>
<li>Ditto Sh</li></ul></li>
<li>Have you read the man pages for your shell? If not, they're a good place to learn about your shell's abilities and functions and how to use them.</li>
<li>What mail program do you plan to use?
<ul><li>Have you read the man page or documentation on that program?</li>
<li>If you do not know what mail programs you have at your disposal, have you tried using the "apropos mail" or "whatis mail" commands to find any such programs?
<ul><li>If you've looked for and want more help finding mail programs, then what platform of Linux are you running? If you don't know, get in touch with the administrators of the system and ask.</li></ul></li></ul></li>
<li>Are you familiar with "cron"?<ul><li>If not, "man cron" from your Linux prompt. Cron will run commands and scripts on a schedule as you seem to need.</li></ul></li>
</ul>

Similar Messages

  • Need a shell script to backup archive log daily

    Hi All,
    We need a shell script to backup the archive logs daily after shutting down the concurrent manager and once the backup is completed, needs to start the concurrent manager through the script itself, if you have any ideas or sample scripts, please provide and help us.
    The objective is to backup the daily archive logs with out any loss of data.
    Thanks,

    I do not have a similar script to share, sorry. However, you may review the following links/notes:
    Note: 137181.1 - RMAN Backup Shell Script Example
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=137181.1
    Recovery Manager (RMAN) Manuals
    http://www.oracle.com/pls/db102/homepage

  • I need a shell script to move latest archivelogs from one server to another server..

    Hi,
         I need a shell script to move latest archivelogs from one server to another server..
    Thanks&Regards,
    Vel

    ea816fb9-f9ea-45ac-906f-36a8315970d0 wrote:
    Thanks it's really helpfull..
    Now i have pasted a shell script which generates archivelog and shows latest archivelog time..
    just check let me know the answer, that how i need to execute it..
    # Force a logswitch to get the last archivelog to the standby host
    ORACLE_SID=ORCL
    ORAENV_ASK=NO
    . oraenv >/dev/null 2>&1
    SwitchLogfile()
      # Do logswitch 
      RESULT=`echo "Alter system switch logfile;" | sqlplus -S / as sysdba | grep 'System altered'`
      if [ "$RESULT" = "System altered." ]
      then
      export RETURN=1
      else
      export RETURN=0
      fi
      # Do we need to do something with this return value?
      export RETURN
    GetArchiveTime()
      CURYEAR=`date +%Y`
      echo "set heading off;" > temp.sql
      echo "set termout off;" >> temp.sql
      echo "select to_char(first_time,'YYYY-MM-DD HH24:MI:SS') from v\$archived_log where sequence#=(select sequence# - 1 from v\$log where status='CURRENT');" >> temp.sql
      sqlplus -S / as sysdba <
    spool tempres.txt
    @temp.sql
    quit
    EOF
    cat tempres.txt | grep ${CURYEAR} | grep -v grep | awk '{print $1" "$2}'
    #rm -f temp.sql  tempres.sql
    SwitchLogfile
    GetArchiveTime
    You seem to have ignored Dude's VERY good advice and continue to press down this ill-advised path.  If you continue this approach, you WILL have problems at the very time you do not need any additional problems.  Trying to recover your production database at 2:00 in the morning is not the time to be getting errors from rman because it can't find what it needs - because you decided to move them around yourself.
    Please reconsider.

  • Need a shell script file in snow leopard to start and stop VPN connection

    As the Question says, I need a shell script file to do this, and since I don't know anything about creating a script file I wanted to ask the Groups help.  I need it because I need to run a backup program, and need the backup program to run the Connect script to connect to the VPN before it starts the backup, and then when it completes the backup to run the disconnect script.  Your help is greatly appreciated.  Thanks.

    Hi, thanks for your prompt reply. However my real problem is not starting
    it but stopping it cleanly. I am forced to restart the display from time to time (once/per hour) because it is getting 'stuck' for some reason and the web page is out of my control.
    I tried simply killing the firefox process using kill command and then starting a new one but it works one or two times and then the next firefox process demands mouse communication. And that is not available. Also this has to work without any expert present as the display is in a public area.

  • Need UNIX Shell script

    My file(xxx.mf) contains big single line which includes header,details,tailer and number of records.
    example
    RA.........RW...RS.....RW....RS.....RW...RS..RT...39214
    This RA......... header record(1024 bytes)
    RW...RS.....RW....RS.....RW...RS..(38MB approximately)
    RT...Tailer record(1024 bytes)
    39214 number of records.
    User needs as
    RA......
    RW..
    RS...
    RW..
    RS...
    RW..
    RS..
    RT.....
    39214
    I need shell script to get above result. Please help me regarding this.

    trivial ksh shell script to insert linefeed characters in file
    #!/bin/ksh
    # copy input file and insert linefeed characters in output file
    # parse string and insert linefeed after each fixed-length record
    # input file: testin.txt
    # contains 10 5 character records in one string
    # R0001R0002R0003R0004R0005R0006R0007R0008R0009R0010
    # output file: testout.txt
    # contains 10 records separated by linefeed
    # R0001
    # R0002
    # R0003
    # R0004
    # R0005
    # R0006
    # R0007
    # R0008
    # R0009
    # R0010
    # arguments:
    # $1 input filename
    # $2 output filename
    str=`cat $1`
    rec_len=5
    str_len=$((`expr length ${str}`))
    rec_cnt=$((${str_len}/${rec_len}))
    i=1
    while (( i <= $str_len ))
    do
    rec_out=`expr substr $str $i $rec_len`
    echo ${rec_out} >> $2
    (( i += $rec_len ))
    done

  • Need Power shell script to run on all databases.

    Hi,
    I have a stored procedure to generate report, using power shell script want to get all databases, run stored procedure on each database and generate the results as .csv file, output the file with database name (place it on directory) and  email .csv
    file.
    looking for script, can any one help pls?
    Naveen| Press Yes if the post is useful.

    Can you please share with me the codes
    Naveen| Press Yes if the post is useful.
    Dear N_14
    You can have a look on the followings
    http://www.csharp-station.com/Tutorial/AdoDotNet/lesson07
    http://www.codeproject.com/Articles/415732/Reading-and-Writing-CSV-Files-in-Csharp
    https://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage%28v=vs.110%29.aspx
    Best Regards
    mintssoul

  • I am trying to create a button in flash that will display 4 separate images at the same time when clicked.  I can't get the images to stay on when I take the mouse of the button.  I need the actions script code to make this happen.

    I am trying to create a button in flash that will allow the user to click on the button and 4 separate images show up at the same time.  I can get the images to appear when I click the button but they will not stay on the screen.  I need to know what code I use to make the images stay once the button is clicked, then I need to know exactly where I place that code.  It does not appear to be possible to add the action code to the buttons layer since each time I add a new layer I just get another "up" "over" "down" and "hit" line.
    Thank you in advance
    AP

    It is not clear how you are trying to realize this from your description.  If you are trying to create this within a button symbol it will not work.  Explain your approach and if there is code involved, show what you have so far.

  • How to switch user from the current user using shell script code

    Hi Experts,
    I have an requirement to login into a particular user from the shell script concurrent program. I do have credentials for that particular user. I want to login and run few commands from that particular user. Please let me know if there are any methods to login as a particular user using the username, password from shell script program.
    Thanks a lot.

    Thanks for your reply. However we cannot use su command from a shell script program. How to enter password from shell script program?http://tinyurl.com/3t7cwjh
    Thanks,
    Hussein

  • Help needed in shell script for FTPS

    Hi,
    Im trying to build a script to download files from a secure FTP site.
    When I run the command ftps <host_address> in the unix prompt, it asks username and password, and then prompts the following question.
    Do you want to trust this certificate? y(y):
    From the prompt, I am able to type 'y' and then it is connecting to the FTP site without any issue.
    When i run the shell script which contains the same command ftps <host_address>, it prompts the same question. And then it comes out of the program saying 'Connection aborted'.
    Could anyone tell me how to avoid this prompt?
    Thanks,
    Vidhya

    Ya. It worked for me when i typed the command ftps <host_address> in the command prompt.
    When I type this command, it is asking for username,pwd and after that, it is asking 'Do you want to trust this certificate?'. For this i have typed 'y' (Yes) in the command prompt.
    After i entered 'y', the connection got established properly.
    I have included this command in a shell script, and ran this script.
    When i execute the script, i asks 'Do you want to trust this certificate?'.
    Since i will not be able to type 'y'(Yes) connection is getting aborted.
    So, I want to know how to avoid this question ot how to enter 'y' while executing the script.
    Thanks

  • Rwcgi60 on UNIX needs shell script ?

    I am trying out Reports 6i on a Linux box.
    Using Apache Webserver, I have mapped all the virtual directories with execute permission.
    When I call rwcgi60 through the browser, I get the following output
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <CENTER><H1>
    </CENTER></H1>
    <BR></BODY>
    </HTML>
    But when i call a shell script (which in turn calls rwcgi60) through the browser, i get some output.
    The shell script exports all the environment specific to Oracle Reports and calls rwcgi60.
    Is the CGI intended to be called from a script file ? If no, what other configuration is necessary ?
    Thanks.

    I am having exactly the same problem on Solaris. The information I have shoehorned out of support so far is that you do need a shell script to make this work. I have followed these instructions but am still having problems. The document which details this bug is unpublished by Oracle so I only got extracts. Detailed below.....if you do have success with this please let me know as I am tearing my hair out.
    REPORTS60_SERVER
    1. The REPORTS60_SERVER file is located in your Oracle_Home and is used to
    start the Report Server.
    2. You may need to modify this file for variables such as DISPLAY, TNS_ADMIN
    and the REPORTS60_PATH to fit your environment. @Also, please refer to
    @Note: 111548.1 for setting up the TNSNAMES.ORA file.
    3. If you are not using a WebDB Listener, you can delete the section which
    stops and starts it. However, make sure you have started up your Webserver
    Listener.
    4. Once this file has been modified, the command to execute it is:
    reports60_server start
    Shell Script (RUNREP.SH)
    1. You will need to create a shell script to run RWCGI60. This shell will then
    be called from RUNREP.HTM file. You can name it anything (the example is
    called runrep.sh) and needs to include the following:
    #!/bin/sh (or which ever shell you want to use)
    - ORACLE_HOME="/u03/app/oracle/product/dev6i"; export ORACLE_HOME
    - TNS_ADMIN="/u03/app/oracle/product/dev6i/network/admin"; export
    TNS_ADMIN
    - exec /u03/app/oracle/product/dev6i/tools/web60/cgi/rwcgi60
    2. You will need to redefine the ORACLE_HOME and TNS_ADMIN due to BUG:1201156.
    3. This script can be located anywhere as far as the Webserver
    Listener is
    concerned. However, the best place would be in the ORACLE_HOME/tools/web60/
    cgi directory for which we already have a virtual name defined in the
    listener configuration file.
    RUNREP.HTM
    1. The RUNREP.HTM file is located in the ORACLE_HOME/tools/web60/html
    directory.
    2. You will need to modify this file due to the above mentioned Bug.
    Go to the function called runReport( ) and for the var cgiexe = "rwcgi60",
    replace it with the above shell script.
    Example: var cgiexe = "runrep.sh"
    3. Next, modify the port number for the Webserver. This file assumes that you
    will be using the WebDB listener and is installed on port 8080 (by default).
    You will need to find the following and change it to the correct port
    number:
    <td><input TYPE="TEXT" NAME="WEBPORT" SIZE="4" VALUE="8080"></td>
    Change the Port Number to the one your WebServer Listener is on, such as:
    7777.
    After doing all of the above, you are ready to run a report on the web using
    CGI implementation. From the browser run the following URL:
    http://your_machine_name:listener_port#/virtual_dir_for_cgi/runrep.htm
    This brings up a Template for you to provide the report name. Also change the
    parameter values here for the userid/password, port#, and reports_server.

  • Shell Script for db status

    Dear experts,
    I have to do the below requirments can you please help me on this,
    i have to check the database status on every 2 hour intravel, i need a shell script to check the database status whether up or down, if the status is up i have to call .sql file , if the status is down the mail will be sent to dba team with mailx functionality, can any one plz help me on this? this requirment needs to be used only shell script code. thanks in advance
    Os is AIX
    db version 11.2.0.2

    I can think of a few ways this can mislead...
    expired password
    mail problems (both mail not working, and too much mail on Monday...)
    network problems (for example, db can be up and working, but that client can't get there - false negative)
    Client dead, or process can't start (false postive - no mail, therefore no problem)
    Login storm (so only some new connections rejected, random false negative or false positive)
    Listener down or related login problems, device with executables offline, out of horsepower - users still working, but no new logins.
    Multiple problems (I've seen more than once, both phone lines and power fail, no notification sent)
    Error not discriminatory enough - the email should at least send the error it got.
    False positive - only script can get to db, users can't with modern tiered architecture.
    client tnsnames.ora not available or corrupted.
    Nothing wrong with having a script, you just have to watch the requirements and definitions. More sophisticated solutions have problems too. In the end you have to decide what the operational priorities are. Two hours down might be OK at 4AM but not at 6. You also don't want to stretch the limits of an UPS.

  • How do i print parameters in shell script through java

    Hi,
    I am sorry if have posted this query in wrong thread!!!
    How do i print the parameter in shell script which are passed from java programm?
    i have tried in different ways.. but the actual param value is not printing when i execute the java programm
    java code is here
    import java.io.IOException;
    public class TestShell {
          * @param args
    public static void main(String[] args) {
             String inputFilePath=args[0];
              String inputFileName=args[1];
              String outputFileName=args[2];
              String outputFilePath=args[3];
              Runtime r = Runtime.getRuntime();
              String[] cmdArray = new String[]{"Test.sh",inputFilePath, inputFileName, outputFileName, outputFilePath};
              try {
                   r.exec(cmdArray);
                   System.out.println("Test.sh executed successfully.");
              } catch (IOException e) {
                   e.printStackTrace();
    }I need a shell script to print paramenters (inputFilePath, inputFileName, outputFileName, outputFilePath)
    Thanks,
    Jasmin

    user13836688 wrote:
    But my code is something look like thisWell unless I've completely lost my marbles (possible) or Java Runtime.exec() does something I've never heard of, I can't even see how that will execute. For a start, assignments in the Bourne shell take the form ofinfile = $inputFilename;orinfile = "inputFilename";not what you've got; and the first form would only work if you've set the appropriate environment variables.
    Are you sure you're not confusing this with a Javascript script?
    Winston
    Edited by: YoungWinston on Apr 18, 2011 12:51 PM
    And BTW, you don't need to put ';' at the end of each statement, unless there's more than one on a line.
    Edited by: YoungWinston on Apr 18, 2011 12:54 PM
    BTW2: 'printf "%d", inpath' also looks very dodgy, since 'inpath' is unlikely to be a number (in fact, it's unlikely to be anything).
    I think you might want to get a book on scripting.

  • FTP files from Unix box to Windows ( Shell script )--inplemention in Apps

    Hi,
    I have an requirement like need to send files generated at a particular path in the UNIX sever into Windows machine.
    This should be a scheduler( can we create any shell script
    ) for this...
    Note : files generated at Unix move into Windows box....
    Please check and help on this... and let me know if any clarification required on my requirement.
    Thanks,
    Pavan K

    This is relatively easy to do. You will need to write the shell script code and register it as a concurrent program of type "Host". Pl see the Application Developer Guide (for 11i and R12) at http://www.oracle.com/technology/documentation/applications.html for details on how to register a shell script "Host" custom program.
    ML Docs 266268.1, 147455.1, 1013907.6 and 156636.1 have some more info too.
    HTH
    Srini

  • How to parse a text file and produce a dynamic shell script for linking?

    I have some mapping files, one example is like this one;
    $ cat CON_xfrm_contract_to_20080302.map
    (object mfile_c_type
    (path "file:OBSOLETE")
    (fs "file://amanos/s01/abinitio/data/prod/mfs/mfs_16way")
    (local_paths 16
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_002/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_003/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_004/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_005/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_006/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_007/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_008/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_009/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_010/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_011/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_012/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_013/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_014/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_015/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"
      "file://amanos/s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat"))In this file's content I have some exracted text files with same names under different folders;
    $ ls -lt /s01/abinitio/data/prod/mfs/parts/mfs_16way_*/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat   [
    -rw-rw-rw-   1 ab_live  abinitio 438652105 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_010/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438490410 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438219252 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_007/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438521432 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_014/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438488130 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_003/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438249547 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_002/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438312177 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_012/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 439074566 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_015/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438722261 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_004/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438742477 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438517268 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_008/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438645835 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_011/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438334994 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_006/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438470743 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_005/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438095853 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_009/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    -rw-rw-rw-   1 ab_live  abinitio 438434204 Mar  3 01:42 /s01/abinitio/data/prod/mfs/parts/mfs_16way_013/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.datI need a shell script which will produce a shell script from the content of the mapping file so that I can be able to symbolicly link these files with different names and under the same folder, like;
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat ./mfs_16way_001.CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat ./mfs_16way_016.CON_xfrm_contract_to_20080302.datI am a newbie for shell scripting, I tried several awk and sed operations but couldn't get close to this output :(
    If you guide me I will be so glad, thank you.
    ps: amanos is the name of this server.

    this is thepoint that I am stuck, I can not add the destination sym.link name to the end of each line;
    $ grep "  \"file://amanos" CON_xfrm_contract_to_20080302.map | cut -c17- | sed  's/"//;s/)//g' | sed 's/\/s01/ln -s \/s01/g'
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_001/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_002/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_003/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_004/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_005/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_006/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_007/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_008/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_009/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_010/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_011/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_012/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_013/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_014/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_015/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    ln -s /s01/abinitio/data/prod/mfs/parts/mfs_16way_016/mfs_16way/Applications/RDS/CON_PUB/main/CON_xfrm_contract_to_20080302.dat
    $ /)//g' | sed 's/\/s01/ln -s \/s01/g' | awk -F\/ '{print $8"."$14}'                                                       <
    mfs_16way_001.CON_xfrm_contract_to_20080302.dat
    mfs_16way_002.CON_xfrm_contract_to_20080302.dat
    mfs_16way_003.CON_xfrm_contract_to_20080302.dat
    mfs_16way_004.CON_xfrm_contract_to_20080302.dat
    mfs_16way_005.CON_xfrm_contract_to_20080302.dat
    mfs_16way_006.CON_xfrm_contract_to_20080302.dat
    mfs_16way_007.CON_xfrm_contract_to_20080302.dat
    mfs_16way_008.CON_xfrm_contract_to_20080302.dat
    mfs_16way_009.CON_xfrm_contract_to_20080302.dat
    mfs_16way_010.CON_xfrm_contract_to_20080302.dat
    mfs_16way_011.CON_xfrm_contract_to_20080302.dat
    mfs_16way_012.CON_xfrm_contract_to_20080302.dat
    mfs_16way_013.CON_xfrm_contract_to_20080302.dat
    mfs_16way_014.CON_xfrm_contract_to_20080302.dat
    mfs_16way_015.CON_xfrm_contract_to_20080302.dat
    mfs_16way_016.CON_xfrm_contract_to_20080302.datMessage was edited by:
    antu
    Message was edited by:
    antu

  • SHELL SCRIPT FOR EXPORT AUTOMATICALLY

    Hi all,
    I need a shell script which will automatically take logical backup(export) in the solaris machine.I have 5 database and 10 schemas for that i want to take logical backup.
    thanks
    vicky

    If you're using 10g try to do it with DBMS_DATAPUMP and DBMS_SCHEDULER

Maybe you are looking for