BASH Scripting
"David Nithakorne" <[email protected]>
| Newsgroups | gmane.linux.redhat.release.enigma |
|---|---|
| Message-ID | <[email protected]> |
I am trying to set the value of SIDS in the following script to
something other than "". It seems that once out of the do/done block the
value od $SIDS reverts back to ""....why is this and how can I get $SIDS
to keep its new value opnce out of the do/done block.
# !/bin/sh
SIDS=""
grep -v '^#' /etc/oratab | while read LINE
do
ISID=`echo $LINE | cut -f1 -d:`
OHOME=`echo $LINE | cut -f2 -d:`
OBOWNER=`ls -l $OHOME/bin/sqlplus | awk '{print $3}'`
SIDS=`echo "$SIDS $OBOWNER:$ISID"`
echo "SIDS is $SIDS"
done
echo SIDS is $SIDS
echo "OBOWNER is $OBOWNER"
the /etc/oratab file is: -
#
#
LD4U:/opt/oracle/product/9.2.0:Y
oem:/opt/oracle/product/9.2.0:Y
ld4udev:/opt/oracle/product/9.2.0:Y
Thanks
David