George Zeigler wrote:
<snip>
separator character (e. g. TRANS="/usr/local/lib/trans/") which could be a link to the actual directory. What is TRANS? And what is this TRANS="usr/local/lib/trans" ? There is no /usr/local/lib/trans directory. And I've never linked a directory. Still don't get this part. I think I am supposed to create a trans
Hello, directory and link it. What for?
<snip>
Where do I set environment variables? I did the 'env' command. The manual has little about this.
TRANS here is a user-defined environment variable. To understand environment variables, you have to understand shell variables. Shell variable is a name that has a value associated with it.
OK. Following.
Shells (like bash) have several built-in shell variables (e.g. PATH, PS1 etc.), users can add their own by using the following syntax: OK
varname=value (no whitespace around "=")
I'm taking it that 'varname' is not a command. That in my case, TRANS is the 'varname'. Correct? And the 'value' is the path, which is "usr/local/lib/trans", with quotes.
This is exactly what that instruction about TRANS refered to. To use the value of a variable, precede its name by a dollar ($) sign (e.g. echo $PATH).
OK. So then cd "$TRANS"bin is actually cd /usr/local/lib/trans/bin Correct? Seems that their should be a '/' between "$TRANS" and bin.
The user-defined shell variables are not visible to subprocesses, i.e. the commands you execute. Only a special kind of shell variables called "environment variables" are visible to subprocesses. The built-in variables I refered to earlier are actually environment variables. To promote a shell variable to environment variable, you need to "export" it:
export varname (export a shell variable) so export TRANS
is what I will do, if I already set trans as a user-defined variable.
or
export varname=value (define & export a shell variable)
so export TRANS="usr/local/lib/trans" sets 'TRANS' as an environment variable.
It is also possible to define environment variables visible to only a particular subprocess:
varname=value command
TRANS="usr/local/lib/trans" subprocesses? Does this mean that when I turn my computer on in the morning, this variable will be gone?
This way, varname becomes part of the environment of subprocess "command". To see all the shell & environment variables currently active:
set
This should list all the variables with their values.
Hope that clears things for you.
It helped. Thanks George
Nadeem
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
-- My personal website http://www.firstnethou.com/gz/welcome.ht -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/