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: awk and ksh question - solved

RE: awk and ksh question - solved

From: Stephen Lee <Stephen.Lee_at_DTAG.Com>
Date: Tue, 04 Feb 2003 06:49:55 -0800
Message-ID: <F001.0054307B.20030204064955@fatcity.com>

-----Original Message-----
awk and ksh are both interpreting $1.


Not possible. One or the other will see "$1", but not both. That's the problem with using quotes instead of assigning things to awk variables -- It makes reading the stuff confusing.

FWIW, here is what I do:

   ## See if there is anything to send
   COUNT=`awk '/^$/ {next}; END {print NR}' "$PAGE_FILE"`    ## If so send it
   if [ $COUNT -gt 0 ]; then

      PAGER_PERSON=''
      cat "${ADMIN_DIR}/who_to_page" | while read LINE; do
         PAGER_PERSON="${PAGER_PERSON},${LINE}"
      done
      ## Optional cleanup lines for the intractably paranoid
      PAGER_PERSON=`echo "$PAGER_PERSON" | sed 's/[   ]*//g'`
      PAGER_PERSON=`echo "$PAGER_PERSON" | sed 's/^,*//g'`
      PAGER_PERSON=`echo "$PAGER_PERSON" | sed 's/,,*/,/g'`
      if [ -n "$PAGER_PERSON" ]; then
         mailx -s "IT IS ALL OVER THE WALLS" "$PAGER_PERSON" < "$PAGE_FILE"
      fi

   fi
--

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

Author: Stephen Lee
  INET: Stephen.Lee_at_DTAG.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 - 08:49:55 CST

Original text of this message

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