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: Re[2]: awk and ksh question - solved

RE: Re[2]: awk and ksh question - solved

From: Koivu, Lisa <Lisa.Koivu_at_efairfield.com>
Date: Tue, 04 Feb 2003 09:25:19 -0800
Message-ID: <F001.00543697.20030204092519@fatcity.com>


I'll check it out. Yes that sounds like it would be easier.

That is, when our cluster finally comes back up and the app servers are fixed. GRRRRRRRRRR

Thanks to all that replied.

-----Original Message-----
Sent: Tuesday, February 04, 2003 9:11 AM To: Multiple recipients of list ORACLE-L

It still seems like overkill to me. I just put the pager addresses in
a alias in either /etc/aliases or .mailrc as a list for dba_oncall,
eliminating the need for db_oncall.txt.

In /etc/aliases:

db_oncall: 9991234567_at_pageme.co, lisa.koivu_at_efairfield.com

Or in .mailrc

alias db_oncall 9991234567_at_pageme.co lisa.koivu_at_efairfield.com

Then when I want to send them a file I do:

$ cat FILE_TO_SEND | mail -s FILE_TO_SEND dba_oncall

No messing with awk or special characters, or worrying what shell it runs in, I know the mail aliases live where all the other mail aliases live so I don't have to go hunting for special files when something needs to change.

KL> Stephen, I'm aware of the syntax. My question was, WHY?? Robert hit it on
KL> the head, awk and ksh are both interpreting $1.

KL> Anyway I solved the problem with shift, like this. Thanks to all that KL> replied.

KL> export PAGER=
KL> export PAGERFILE=dba_oncall.txt
KL> export FILE_TO_SEND=$1
KL> shift ;

KL> if [[ $# = 1 ]]
KL> then

KL> export SUBJECT="Subject: $1";
print $SUBJECT >> $$.log
KL> shift ;

KL> fi;

cat $FILE_TO_SEND >>> $$.log

KL> for PAGER in ${*-$(awk '!/^#/ {print $1}' dba_oncall.txt)}; KL> do

KL>     print $PAGER 
KL>     sendmail $PAGER < $$.log


KL> done

--

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

Author: Robert Eskridge
  INET: bryny_at_dfweahs.net

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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.net
--

Author: Koivu, Lisa
  INET: Lisa.Koivu_at_efairfield.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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 Tue Feb 04 2003 - 11:25:19 CST

Original text of this message

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