Access variables from profile file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Access variables from profile file
# 1  
Old 06-11-2008
Access variables from profile file

Hi all,

I hav created one profile file in which i have declared some variables
i want to knw how can i access these variables into my xyz.ksh file when i am trying to do " echo $variablename " its giving me an empty line i have done export variable also in the profile file.

Thanks in advance..
# 2  
Old 06-11-2008
Run the profile script in the current shell:

Code:
. yourscript

Regards
# 3  
Old 06-11-2008
I have run the profile file using ". . profile " i am still not able to echo all the variables.
# 4  
Old 06-11-2008
Hi navi,

Run as

. .profile ( No space netween second dot and profile)

Thanks
Penchal
# 5  
Old 06-11-2008
Hi Guys ,

sorry for that that was a typing mistake Smilie i executed the same way as ur sugestin
# 6  
Old 06-11-2008
Can you post your .profile file here..?
# 7  
Old 06-11-2008
Hi All,

Looking for some sugesstions on this i still am not able to access the variables exported through the profile file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to access the bash variables in csh

Hi, I am having a primary script which is Bash based. I am calling a csh script from it. Now, their are some variables defined in my bash script which i need in csh. I am unable to do so. Is it possible ? (2 Replies)
Discussion started by: vdhingra123
2 Replies

2. AIX

Profile environment variables lost after mksysb restore

Hello. I restore an mksysb image (AIX 5.3 TL 11) from one model to another model of Power (power 5 to power 7). Everything seems good, but I lost environment variables of at least one of a user profile. The result of the "env" command show me great differences between two servers, first of them... (2 Replies)
Discussion started by: stephnane
2 Replies

3. Programming

Regarding the protected variables access

Hello forum, I am siva working as programmer .I was blocked with the below issue so please help any of the forum memebers. testve.h class cv { protected : struct state; state& m_state; }; testVe.cpp struct state { m_size; } the above are 2 files which have the... (3 Replies)
Discussion started by: workforsiva
3 Replies

4. Shell Programming and Scripting

Crontab jobs don't see variables defined in /etc/profile

Is it true that Crontab jobs don't see variables defined in /etc/profile? How to get around that? (4 Replies)
Discussion started by: proactiveaditya
4 Replies

5. Shell Programming and Scripting

problem in access in array variables

hi all, its me again!!! i've requirement like this: i want to create a file & an array with its name having the filename as its substring. here is the test script!! #!/bin/bash touch $1 declare -a $1_rec; echo -n "$1_rec: " read $1_rec; echo $]; now see output: this is when i enter... (7 Replies)
Discussion started by: tprayush
7 Replies

6. Shell Programming and Scripting

how to access variables in a config file inside a shell script

I'm writing a shell script. I want to put the variables in a separate config files and use those inside my script. e.g. the config file (temp.conf)will have the values like mapping=123 file_name=xyz.txt I want to access these variables in temp.conf(i.e. mapping and file_name) from inside the... (7 Replies)
Discussion started by: badrimohanty
7 Replies

7. Shell Programming and Scripting

Access Awk Variables Outside Scope

My awk script searches for specified patterns in a text file and stores these values into mem variables. Once this is done I want to Insert these values into a table. How can I avail of the variable values outside the scope of awk script.... One method that I have tried is to write the... (7 Replies)
Discussion started by: Amruta Pitkar
7 Replies

8. Shell Programming and Scripting

How to access variables across scripts

Hi All, I have declared a variable in script1 and assign a value for it. In script2 i'll call script1 and then I want the value of variables set in script1. I have tried with export, but in vain. How can I achive this? Below is the two scripts. --script1 #!/usr/bin/ksh echo $1... (1 Reply)
Discussion started by: javaDev
1 Replies

9. UNIX for Advanced & Expert Users

Access Awk Variables Outside Scope

Sorry in the wrong forum. Moving this to right forum. (2 Replies)
Discussion started by: Amruta Pitkar
2 Replies

10. UNIX for Dummies Questions & Answers

Read variables from Access table

Hi! I've just started learning shell scripting, and have been somewhat 'thrown in at the deep-end and told to swim' so excuse my complete lack of knowledge and ignorance, but here goes... I've been given a unix script to 'tidy up'. Basically the script consists of the few lines of code being... (2 Replies)
Discussion started by: Sn33R
2 Replies
Login or Register to Ask a Question