X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=0.8 required=5.0 	tests=AWL,BAYES_50,J_CHICKENPOX_45
X-Spam-Check-By: sourceware.org
From: Hubert Samm <iamsamm@sammiam.us>
To: cygwin@cygwin.com
Subject: problem under cygwin with sh, bash, ksh
Date: Fri, 6 Mar 2009 07:26:35 -0600
User-Agent: KMail/1.9.10
MIME-Version: 1.0
Content-Type: text/plain;   charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Message-Id: <200903060726.35848.iamsamm@sammiam.us>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Hi All...  I've searched and found nothing....  this script runs just fine on 
AIX, Solaris, and Linux, but under cygwin, the array VALUE prints only 
blanks.. has anyone else run into this... I've tried a bunch of different 
things around typecast, etc, but it looks like VALUE is local in the table_it 
function...  any thoughts???


table_it()
{
   case "$1" in
      class) VALUE[0]=$2 ;;
      source) VALUE[1]=$2 ;;
      server) VALUE[2]=$2 ;;
      sub_source) VALUE[3]=$2 ;;
      msg_catalog) VALUE[4]=$2 ;;
      epage) VALUE[5]=$2 ;;
      threshold) VALUE[6]=$2 ;;
      *) echo "UNKNOWN $1 $2" ;;
   esac
}
 
 
TEMP1=/tmp/parse_log4j_01
 
 
find $1 -type f -print | while read filename rest
do
 
 
   echo "$filename"
 
   grep "Tec_" $filename | dd conv=lcase 2>/dev/null | sed -e 's/<param 
name="//
' -e 's/\/>//' -e 's/"//g' -e 's/value=//' -e 's/tec_slotpair//' -e 's/tec_//' -
e 's/,/\n/g' -e 's/:/ /g' | while read flip flop
   do
      table_it $flip $flop
   done
   grep "tec_" $filename | dd conv=lcase 2>/dev/null | sed -e 's/<param 
name="//
' -e 's/\/>//' -e 's/"//g' -e 's/value=//' -e 's/tec_slotpair//' -e 's/tec_//' -
e 's/,/\n/g' -e 's/:/ /g' | while read flip flop
   do
      table_it $flip $flop
   done
 
   echo "0 ${VALUE[0]}"
   echo "1 ${VALUE[1]}"
   echo "2 ${VALUE[2]}"
   echo "3 ${VALUE[3]}"
   echo "4 ${VALUE[4]}"
   echo "5 ${VALUE[5]}"
   echo "6 ${VALUE[6]}"
 
 
  
 
done

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

