problem in getting the path of environment variable set in bashrc in my shell script

hi all

i have joined new to the group.

i have set an variable in my bashrc file.
.bashrc
PROGHOME=/home/braf/braf/prog
export PROGHOME

but while using it in my shell script its path is not taken and i had to explicitly give the export command to set the path.

in my script file
PROGHOME=/home/braf/braf/prog
export PROGHOME

if i give export the script is executing and taking the file from correct path but not directly from bashrc.

can anyone help me over this plz

I think you are executing the script by correct user.

If you have set varibale in your .bashrc file and then are you running the script under the same profile?

because evry time one logg's in .bashrc gets executed if not then it will not..

thanks nilesrex

but i am runing the script in the same user and in the same shell.
in the shell promt when i do echo , i get the correct path.
only the script i dont get it.

i hope i have understood ur question properly and replied.

You have to check your login shell, is it really bash? type command echo $SHELL to find out your login shell and then modify appropriate login file as per your shell.

i checked its also correct
/bin/bash is what i had used in my script file also

Once you logged in to your login you can do echo $PROGRAM,

and check if this variable is getting set correctly if it is not that means ur .bashrc is not getting executed..

after loged in my user and if i give echo $PROGHOME it gives
/home/braf/braf/prog ie its giving the correct path...
but only inside the script its not getting the path properly and i had to do export again to get the correct path

are you sure you are not doing typo in side the script??

thnx nilesrex and sheerenmotor..

actually i had been calling the script through the load leveller [job manager] and i learnt tht i had to mention "evnironment = COPY_ALL" if i have to get the variables set in the bashrc .
thats y it wasnt taking my variables and i had explicitly do an export.

i once again thank nilesrex for patiently helping me.. thanks a lot.