Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: KSH Scripting Questions

RE: KSH Scripting Questions

From: Kevin Lange <kgel_at_ppoone.com>
Date: Mon, 10 Dec 2001 12:56:21 -0800
Message-ID: <F001.003D93DB.20011210123532@fatcity.com>

Thanks John.

-----Original Message-----
Sent: Monday, December 10, 2001 2:16 PM
To: Multiple recipients of list ORACLE-L

Yes, you can create a function in your program and call it or call another program.

my_function ()
{
  clean this
  clean that
}

trap "my_function" 0 1 2 ...

You can have different cleanup routines for different events or one cleanup routine and pass it the event type as:

trap "my_function 1" 1
trap "my_function 2" 2

.
.
.



Good Luck,
John

>>> kgel_at_ppoone.com 12/10/01 11:30AM >>> Yes. This should remove the files if any problems occure.

Can you call a subprogram in the trap line or does all the code need to be in-line ?? It would be great if I can just call 1 cleanup routine.

-----Original Message-----
Sent: Monday, December 10, 2001 12:30 PM To: Multiple recipients of list ORACLE-L

I use this in one of my scripts. Is this what you are looking for?

# Make sure temp file get removed.
trap "rm -f $file; exit" 0 1 2 3 4 5 6 7 8 10 11 12 13 15 16 17

HTH,
John

>>> kgel_at_ppoone.com 12/10/01 08:55AM >>> I have a kshell script that I am trying to perform an oracle operation.

Everything works fine in the script excpet cleanup.

One section of the script spools off a monitor job that watches the script for any failures by use of flag files and file checking. This all works well UNTIL the main program ends before the monitor programs.

What happens is , that when the main program ends, the monitor closes down because it was spawned by the main program. Because of this, no all the flag files are getting deleted.

I need to know the proper trap to set and its syntax to catch an ending program so that I can get it to delete the flag files.

Anyone have any ideas ??

Thanks

Kevin

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Kevin Lange
  INET: kgel_at_ppoone.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: John Carlson
  INET: jcarlson_at_CJ.COM

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Kevin Lange
  INET: kgel_at_ppoone.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: John Carlson
  INET: jcarlson_at_CJ.COM

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Kevin Lange
  INET: kgel_at_ppoone.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Dec 10 2001 - 14:56:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US