|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Subject: Creating an environment variable on linux
My system is Linux Fedora Core 1. The shell scripts used here are bash ones (not sh, nore csh). I want to create an new environment variable. It is easy: there is a command!!
#export PATH=”/usr/local/ActiveTcl/bin:$PATH” I tape on my console: #echo $PATH I got the expected result. BUT, when I close the console window, the value of the environment variable is to its initial value. In fact, that directory “/usr/local/ActiveTcl/bin” is no longer here, as if I never tape the command #export PATH=”/usr/local/ActiveTcl/bin:$PATH”. So, I have to tape it many times I need it. Can use the .bash_profile file to create an new environment variable??? Where can declare new environment variables? Please help me... |
|
#2
|
||||
|
||||
|
Yes, you can use .bash_profile to add new things to your environment.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
I did what you told me, but the result is still the same.
I did what you told me, but the result is still the same. I wrote in .bash_profile file these lines:
PATH=$PATH:/usr/local/ActiveTcl/bin Export PATH Can you tell me how to create a new one? Forget now the PATH environment variable!! Let’s say TRIAL_VAR. I wrote in .bash_profile file these lines: TRIAL_VAR =/usr/local/ActiveTcl/bin Export TRIAL_VAR Then, in the console I tape: # echo $TRIAL_VAR I got no thing… This means that TRIAL_VAR isn’t declared yet. To fix the ideas, the USER environment variable is not declared in .bash_profile file. Nevertheless, when I tape: # echo $USER I got “root”. CONCLUSION, variable declarations should not be done in .bash_profile file!!!!Where? I don’t know… Please help me… |
|
#4
|
||||
|
||||
|
Use 'export' instead of 'Export' and it should work.
Code:
TRIAL_PATH=/usr/local/ActiveTcl/bin export TRIAL_PATH Testing it... Code:
[mb@klinger mb]$ echo $TRIAL_PATH /usr/local/ActiveTcl/bin |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Subject: Creating an environment variable on linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|