*** how to set up a variable in Linux? ***
I am a newbie. I know this is a little off-stream of programming, but it is the problem when I tried to program in linux. I wonder if there is a way to set up a variable, say $VAR = /home/root, so that I can use
cd $VAR instead of cd /home/root |
You are looking for this :).
http://www.ee.surrey.ac.uk/Teaching/Unix/unix8.html You can set them temporarily or too last for ever. |
on the prompt type
VR=/home/root then CD $VAR should work like cd /home/root note: this variable is only valid in the shell u defined it in. its a local variable to make it permanent you would have to define it in ~/.bashrc |
All times are GMT -5. The time now is 04:34 PM. |