![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setting environment variable on a remote solaris machine using shell script | eamani_sun | Shell Programming and Scripting | 1 | 05-30-2008 07:05 PM |
| :: in PATH environment variable | gfhgfnhhn | Shell Programming and Scripting | 1 | 05-11-2006 08:29 AM |
| Path Environment Variable | tancy | Shell Programming and Scripting | 3 | 04-08-2006 03:38 AM |
| HISTSIZE environment variable problem | Kenneth2006 | UNIX for Advanced & Expert Users | 5 | 01-17-2006 06:57 AM |
| How does the PATH and MANPATH environment variable get set? | vtran4270 | UNIX for Advanced & Expert Users | 3 | 08-22-2002 11:09 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem in getting the path of 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 Last edited by krithika; 05-24-2006 at 05:10 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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.. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
|||
|
|||
|
i checked its also correct
/bin/bash is what i had used in my script file also |
|
#6
|
|||
|
|||
|
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.. |
|
#7
|
|||
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |