![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| extracting parameter from file | bp_vardhaman | Shell Programming and Scripting | 9 | 09-04-2008 11:24 PM |
| reading the parameter from another file | dsravan | Shell Programming and Scripting | 15 | 12-20-2007 05:59 PM |
| how do I make dynamic parameter names? Or get the value of a parameter evaluated twi | Awanka | Shell Programming and Scripting | 2 | 04-19-2007 10:37 PM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
| max file parameter ( urgent ) | fmmq | Filesystems, Disks and Memory | 2 | 07-25-2002 06:00 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Reading a Parameter File
Hi,
I need to read the parameters from a file and assign them to Global variables. I need to read a specific parameter value every time and pass it to the other script. Suppose i have a parameter file like PARAM.txt PAR1= VAL1 PAR2= VAL2 PAR3= VAL3 I want to read PAR2 file and in the next run i need to read PAR3. can any one suggest me the how to read PAR2 value into global variable GLOB1? |
|
||||
|
Code:
while read rec
do
eval "$rec"
done < PARAM.txt
export GLOB1="$PAR1"
......... commands here
export GLBOB1="$PAR2"
........ more commands here
That sets all the PAR[n] variables inside the script. I'm am not clear on the rest of your requirement. In PARAMS.txt there cannot be any spaces around the = otherwise this will not work. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|