Hello, does anyone understand environment variables? I conpiled a program that transliterates character sets, and I don't understand the following instructions. I did make all These are the rest of the instructions.
After that, please change your working directory to the "./trans120/bin" directory. There you will find files called "*" for U*IX and "*.bat" for MS-DOS. This package is being maintained under Linux but has originally been developed under MS-DOS. OK. I have these.
Please set an enviroment variable TRANS that points to the directory where all the program sources reside *including* the trailing directory 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.
It makes life much easier and you can create your programmes and tables completely independend from the source tree. That lost me.
All Character Encoding Description Files have to reside in the cedf subdir. If you don't set a variable TRANS "/usr/local/lib/trans" will be assumed (see file "tab.h", DIR_TRANS). Where do I set environment variables? I did the 'env' command. The manual has little about this.
To test the translator generator, type
cd "$TRANS"bin one There is a file 'one' and a file 'one.bat'. Typed 'one'. Did nothing.
Thanks George -- My personal website http://www.firstnethou.com/gz/welcome.htm -- 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/
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.
<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. Shells (like bash) have several built-in shell variables (e.g. PATH, PS1 etc.), users can add their own by using the following syntax: varname=value (no whitespace around "=") 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). 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) or export varname=value (define & export a shell variable) It is also possible to define environment variables visible to only a particular subprocess: varname=value command This way, varname becomes part of the environment of subprocess "command". To see all the shell & environment variables currently active: et This should list all the variables with their values. Hope that clears things for you. 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/
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/
George Zeigler wrote:
Hello,
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 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?
ome program wants to know the location of the library. It is made / compiled to look for an environment var named "TRANS". Its value points to the library (or the lib dir). When you switch off your machine, it's gone for good. Therfor it is sendsible to be set in either your $HOME/.bashrc or (IMHO better) in /etc/profile (/etc/profile.local seems to be another, better choice, dig last weeks archives, there is a thread on where to set variables, depending the way you log in) use "export TRANS=/...." to make sure the var will be exported to a doughter shell... Juergen -- =========================================== __ _ Juergen Braukmann juergen.braukmann@gmx.de| -o)/ / (_)__ __ ____ __ Tel: 0201-743648 dk4jb@db0qs.#nrw.deu.eu | /\\ /__/ / _ \/ // /\ \/ / ===========================================_\_v __/_/_//_/\_,_/ /_/\_\ -- 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/
George Zeigler wrote:
Hello, does anyone understand environment variables? I conpiled a program that transliterates character sets, and I don't understand the following instructions. I did make all These are the rest of the instructions.
After that, please change your working directory to the "./trans120/bin" directory. There you will find files called "*" for U*IX and "*.bat" for MS-DOS. This package is being maintained under Linux but has originally been developed under MS-DOS. OK. I have these.
Please set an enviroment variable TRANS that points to the directory where all the program sources reside *including* the trailing directory 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.
It makes life much easier and you can create your programmes and tables completely independend from the source tree. That lost me.
All Character Encoding Description Files have to reside in the cedf subdir. If you don't set a variable TRANS "/usr/local/lib/trans" will be assumed (see file "tab.h", DIR_TRANS). Where do I set environment variables? I did the 'env' command. The manual has little about this.
To test the translator generator, type
cd "$TRANS"bin one There is a file 'one' and a file 'one.bat'. Typed 'one'. Did nothing.
Well, to create a global variable, at the command prompt type: # MYVAR=myval this will assign the value myval to the variable MYVAR. You can check as follows: # echo $MYVAR I think you are being asked to create a variable 'TRANS' that has a value of the location where you installed the translation program (including the trailing slash). Hope that helps, Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\ -- 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/
On Thu, Feb 24, 2000 at 09:08:22PM +0000, Chris Reeves wrote:
George Zeigler wrote:
Hello, does anyone understand environment variables? I conpiled a program that transliterates character sets, and I don't understand the following instructions. I did make all These are the rest of the instructions.
... snipped
Well, to create a global variable, at the command prompt type: # MYVAR=myval this will assign the value myval to the variable MYVAR. You can check as follows: # echo $MYVAR
Environment variables are defined for each shell process, but must be "exported" (in bash) in order for them to be visible to child processes. This can be done after defining the variable as above, e.g., $ export MYVAR or the two steps can be combined, as $ export MYVAR=myval The values are strings, and must be quoted to includes spaces, etc. The exact syntax varies between different shells. Environment variables are very basic to Unix and other OS's shells, and are used to hold the executable search path (PATH), the shell prompt (PS1), and many other values. In bash, the "set" command can be used to view all defined envars. -- Ken Irving jkirving@mosquitonet.com -- 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/
Ken Irving wrote:
On Thu, Feb 24, 2000 at 09:08:22PM +0000, Chris Reeves wrote:
George Zeigler wrote:
Hello, does anyone understand environment variables? I conpiled a program that transliterates character sets, and I don't understand the following instructions. I did make all These are the rest of the instructions.
... snipped
Well, to create a global variable, at the command prompt type: # MYVAR=myval this will assign the value myval to the variable MYVAR. You can check as follows: # echo $MYVAR
Environment variables are defined for each shell process, but must be "exported" (in bash) in order for them to be visible to child processes. This can be done after defining the variable as above, e.g.,
$ export MYVAR
or the two steps can be combined, as
$ export MYVAR=myval
The values are strings, and must be quoted to includes spaces, etc.
The exact syntax varies between different shells.
Environment variables are very basic to Unix and other OS's shells, and are used to hold the executable search path (PATH), the shell prompt (PS1), and many other values. In bash, the "set" command can be used to view all defined envars.
Sorry, my mistake :( I'll go and crawl back under that stone now... Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\ -- 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/
participants (5)
-
chris.reeves@iname.com
-
genz1968@mtu-net.ru
-
jkirving@mosquitonet.com
-
juergen.braukmann@ruhr-west.de
-
nhasan@usa.net