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

2003-02-04 Thread Koivu, Lisa
Title: RE: Re[2]: awk and ksh question - solved





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.  GRR


Thanks to all that replied.


-Original Message-
From: Robert Eskridge [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 9:11 AM
To: Multiple recipients of list ORACLE-L
Subject: Re[2]: awk and ksh question - solved



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: [EMAIL PROTECTED], [EMAIL PROTECTED]


Or in .mailrc


alias db_oncall  [EMAIL PROTECTED] [EMAIL PROTECTED]


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: [EMAIL PROTECTED]


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: [EMAIL PROTECTED] (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).





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

2003-02-04 Thread Stephen Lee
> -Original Message-
> 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 a lot of companies, if a DBA managed to get into this file, the DBA would
have a short career there.
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephen Lee
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).




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

2003-02-04 Thread Jamadagni, Rajendra
Title: RE: Re[2]: awk and ksh question - solved





We do what Robert says ... aliases ... it just simplifies the work.


Raj
__
Rajendra Jamadagni      MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc. 
QOTD: Any clod can have facts, but having an opinion is an art!



-Original Message-
From: Robert Eskridge [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 9:11 AM
To: Multiple recipients of list ORACLE-L
Subject: Re[2]: awk and ksh question - solved



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: [EMAIL PROTECTED], [EMAIL PROTECTED]


Or in .mailrc


alias db_oncall  [EMAIL PROTECTED] [EMAIL PROTECTED]


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.



This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*2