RE: BASH Scripting

"David Nithakorne" <[email protected]>
Newsgroups gmane.linux.redhat.release.enigma
Message-ID <[email protected]>
Thanks very much for your response which has resolved my problem.
However, it does leave me with a question. I have written the same
script on HPUX and it worked fine there. Is this down to the difference
in behaviour between BASH and KSH?

-----Original Message-----
From: Antonio Galea [mailto:[email protected]] 
Sent: 18 March 2003 18:15
To: [email protected]
Subject: Re: BASH Scripting


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



_______________________________________________
enigma-list mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/enigma-list
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.