Re: BASH Scripting

Antonio Galea <[email protected]>
Newsgroups gmane.linux.redhat.release.enigma
Message-ID <Pine.LNX.4.44.0303181907450.3416-100000@beastieboy.uff.netwise.it>
On Tue, 18 Mar 2003, David Nithakorne wrote:

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

The pipe forks a new command, and your variables are not exported.
Since your oratab file is pretty small, you can read it in block like this:

##################################
lines=`grep -v '^#' /etc/oratab`
for LINE in $lines
do
 ...
done
##################################

-- 
_____________________________________________________________________________
Dr. Antonio Galea       N e t   W i s e                 http://www.netwise.it
Sviluppo tecnico     Tecnologie per il Web    Tel 0461.421016 Fax 0461.426021
-----------------------------------------------------------------------------
Programmers are almost as good at reading documentation 
as they are at writing it.
-----------------------------------------------------------------------------
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.