Exporting variable from config file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Exporting variable from config file
# 1  
Old 09-29-2008
Exporting variable from config file

Hi,

I am exporting the environment variable from config file, but when I echo the variable it does not display any value. Here is the snippet of the code

#!/bin/sh

export ENVIRONMENT_ROOT_DIRECTORY="/cb/$ENVIRONMENT"

echo $ENVIRONMENT_ROOT_DIRECTORY

${JAVA_HOME}/bin/java ${APPLICATION_SYSTEM_PROPERTIES} ${MEM_ARGS} -classpath ${CLASSPATH} \
com.collegeboard.olr.utility.KanaLoad
# 2  
Old 09-29-2008
Do you source the config file?

Code:
. config_file
# or on linux 
source config_file

# 3  
Old 09-30-2008
Not sure what do you mean by source the config file?

Thanks,
Bhavna
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fetching variable from config file

I am using . .profile in my script below I want to fech it it from my configuration file .id_pass_file.txt(it has all user_name and passwords) how can i do this PROFILE_PATH=. .profile AND IN MY SCRIPT $PROFILE_PATH IS THIS CORRECT #!/bin/sh ORACLE_HOME=/var/opt/oracle/product/10g;... (8 Replies)
Discussion started by: rafa_fed2
8 Replies

2. Shell Programming and Scripting

Problems setting or exporting variable when using multiple commands from same line.

I am experimenting with some scripting as a way to learn more about it. I have a simple script that calls two other scripts. Each script echos some stuff to prove it ran and then sets a simple variable and exports it. I cannot get one of the variables to display back in the main calling script... (2 Replies)
Discussion started by: scottrif
2 Replies

3. Shell Programming and Scripting

how to read the variable indivdually from config file

how to read the variable indivdually ( line by line ) in shell script eg : i have the config file where contain cat /home/user01/ilap/conf/input.conf node.txt node2.txt node3.txt i need to run script like /home/user01/ilap/exe/run.sh /home/user01/ilap/conf/input.conf ... (1 Reply)
Discussion started by: mail2sant
1 Replies

4. Shell Programming and Scripting

Parse config file data to script variable

I have a script with few pre defined variables. Also have a config file. Something like this. # config file # Define Oracle User MOD1_TAG=abcde MOD2_TAG=xyzabc MOD3_TAG=def I need to parse the config file and have each of the value copied to different variables. Please suggest what... (1 Reply)
Discussion started by: souryadipta
1 Replies

5. Shell Programming and Scripting

Export command variable exporting problem

I have a txt file from which i am assiging a value to a variable using the code in script1 script1.sh export f=$(sed -n "/Freq *=/ s/.*= *//p" ${R_path}/output.txt) echo "$f" --------> this works in script2 ( which executes the script1) eval ./script1.sh if && ; then echo... (1 Reply)
Discussion started by: shashi792
1 Replies

6. Shell Programming and Scripting

exporting variable

Hi All; I m working on a script and came across an issue ,to explain it briefly here is the sample code echo $HOSTNAME|while read IN; do var=`echo $IN|awk -F "-" '{print $2}'`; export var; echo $var; done now I get the value of $var but when it is out of the while loop it does not return... (3 Replies)
Discussion started by: maverick_here
3 Replies

7. Shell Programming and Scripting

Exporting my dynamical variable won't work?

Even though the idea "might" not be great I still wrote this piece of code to get practice.. Which means that it is the CODE that matters here. Anyways; The intension is to create a program(or do we call it script?) that searches recursively through a folder to find a file - stored in a... (4 Replies)
Discussion started by: Pesk
4 Replies

8. Solaris

variable exporting

Hi, can anyone tell me the difference between the below two examples: Eg-1: # name=bravo # echo $bravo what would be the o/p Eg-2: # name1=jhonny # export name1 # echo $name1 what would be the o/p If the o/p's of both examples are the same then what is the use of the cmd export... (3 Replies)
Discussion started by: rahul_11d
3 Replies

9. Shell Programming and Scripting

how to read the variable from config file

how to read the variable from config file eg: a.cfg below config file config file which contain a=`hostname` b=250 a.sh is shell script echo "$a and $b" if i run "a.sh 1.cfg" it works but when i declare N number of variable it wont works.. can u please suggest for that ? (1 Reply)
Discussion started by: mail2sant
1 Replies

10. UNIX for Dummies Questions & Answers

How to Read a config file and Assign to Variable

I have removeConfig file, it contains the dir paths for removing. I need to read line by line and assign to variable. any idea? (1 Reply)
Discussion started by: redlotus72
1 Replies
Login or Register to Ask a Question