1834508 Members
2127 Online
110068 Solutions
New Discussion

scripting

 
SOLVED
Go to solution
Donald Thaler
Super Advisor

scripting

what does the following script do??

while read -r xx
do
export $xx
done < /u01/scripts/0params.dat
**script continues**
I know that the 0param.dat is a file that has default values for the oracle_home/oracle_sid.
3 REPLIES 3
Sundar_7
Honored Contributor
Solution

Re: scripting

/u01/scripts/0params.dat file probably contains some variable names.

The while loop reads one variable at a time in read-only mode and export the variable so that it can be accessed by the other shells.
Learn What to do ,How to do and more importantly When to do ?
RAC_1
Honored Contributor

Re: scripting

It read (in raw format) the contents of the file /u01/scripts/0params.dat and exports the varibles. (so as to make them available to sub-shells.

man sh-posix for details.

Anil
There is no substitute to HARDWORK
Rodney Hills
Honored Contributor

Re: scripting

0param.dat has shell variables that are set and exported. This is done by reading each line from the file and executing the "export" command.

HTH

-- Rod Hills
There be dragons...