Variable Help
I'm trying to create a variable and I'm not sure were to start. What is the command to create a variable?
Thanks |
What kind of variable are we talking about? Environment variable? A variable in a programming language? You need to be a bit more specific my friend...
|
I'm trying to create a variable ($DOC) in the .bashrc file of my home directory.
|
You can put the line "export DOC=contents" (replacing "contents" with what's meant to go in that variable, obviously) in your .bashrc. You'll need to "source" the file after changing it, either by typing "source .bashrc" or ". .bashrc" in the terminal.
|
Quote:
|
I don't know.. surely you should know? :confused:. What are you using this variable for?
|
Quote:
I'm using the variable as a shortcut to the files in /urs/share/doc |
If all you want to do is to be able to do "cd $DOC" as a shortcut for "cd /usr/share/doc", then yeah, that's fine.
|
When I type "export DOC /usr/share/doc" i get not a valid identifier.
Thanks for your help, I am truely a newie!! |
Looks like an "=" is missing....
I seriously recommend some reading--maybe start with Bash Guide for Beginners--it's free at tldp.org |
If you desire to create a shortcut a symlink my serve you better.
|
All times are GMT -5. The time now is 11:52 AM. |