06-06-2008
Env Variable
Hi,
I have a doubt on Environment variable.
I want to know where and when the envirnment variables are defined?
Thanks & Regards,
Siba
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to set a bash env variable which has @ in its name, for example, @YOGESH@
may i know how do i do this? (4 Replies)
Discussion started by: Yogesh Sawant
4 Replies
2. UNIX for Dummies Questions & Answers
Could you please tell me, which process / file is responsible for the setting of PWD env variable in Solaris
Thanks (1 Reply)
Discussion started by: chaandana
1 Replies
3. Shell Programming and Scripting
Question 1: If I set ENV=$HOME/myenvprofile.ksh, will my script get executed when ever I login to my with KSH. My doubt is we used to put this in .profile of our home directory. SO when ever I login will it executed?
QUestion 2: If I set ENV=`echo "hi"` or 'echo "hi" ', what would be the output.... (0 Replies)
Discussion started by: ramkrix
0 Replies
4. Shell Programming and Scripting
I have 2 scripts t2.sh calls t1.sh. I need to get the vaule of a env variable from t1.sh
/tmp/test$ cat t1.sh
#!/bin/sh
INSTANCE="font/fc-cache"
export INSTANCE
svcadm disable ${INSTANCE}
/tmp/test$ cat t2.sh
#!/bin/sh
. /tmp/test/t1.sh
echo ${INSTANCE}
The above works... (9 Replies)
Discussion started by: honglus
9 Replies
5. UNIX for Dummies Questions & Answers
Greetings:
I need to remove 'RUBYOPT' env variable to install MacRuby. I see it via $env (tchrc).
I checked my (local) .tcshrc, .login, .profile files: not defined there. Apparently, it's not set locally. I know this RUBYOPT is global, since I can see it in another account on my... (4 Replies)
Discussion started by: UncleRic
4 Replies
6. Shell Programming and Scripting
Hello,
I want to cange env variable on SunOS.
I tried:
export GONGA=$GONGA:/users/BANK1/basic/queues/SARON_SPACE1
it changed it only localy for my session.
when i opened a new session (telnet etc') the old value exist.
How can I change it to effact all sessions.
Thanks. (2 Replies)
Discussion started by: LiorAmitai
2 Replies
7. Shell Programming and Scripting
Hi,
I have a small requirement
set -x
`grep IMPACT_HOME=/opt/impact /opt/NETCOOLINST/r.txt | cut -d'=' -f2`
if ;
then
sed 's#IMPACT_HOME=*#d' /opt/NETCOOLINST/r.txt
echo "IMPACT_HOME=" >> /opt/NETCOOLINST/r.txt
sed 's#IMPACT_HOME=*#IMPACT_HOME=/opt/impact#g' /opt/NETCOOLINST/r.txt... (2 Replies)
Discussion started by: dbashyam
2 Replies
8. Solaris
Hi,
Am installing SAP on Solaris 10. How to set env variables permanently?
Reg (0 Replies)
Discussion started by: daggupati453
0 Replies
9. Web Development
(Above from Apache docs).
On my system, using:
SetEnvIf User-Agent Mozilla IsBad=1
Order allow,deny
Allow from all
Deny from env=IsBad ...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs. (1 Reply)
Discussion started by: gnurob
1 Replies
10. Shell Programming and Scripting
Hi All,
I have a requirement where I have a config file, which contains 2 coulmn.values of first column are environmnet variable, whose value is defined in an environment file.
In my script I need to read the config file, and get the value of the config file variable from env file.
I... (2 Replies)
Discussion started by: alok2082
2 Replies
LEARN ABOUT MOJAVE
variable
variable(n) Tcl Built-In Commands variable(n)
__________________________________________________________________________________________________________________________________________________
NAME
variable - create and initialize a namespace variable
SYNOPSIS
variable ?name value...? name ?value?
_________________________________________________________________
DESCRIPTION
This command is normally used within a namespace eval command to create one or more variables within a namespace. Each variable name is
initialized with value. The value for the last variable is optional.
If a variable name does not exist, it is created. In this case, if value is specified, it is assigned to the newly created variable. If
no value is specified, the new variable is left undefined. If the variable already exists, it is set to value if value is specified or
left unchanged if no value is given. Normally, name is unqualified (does not include the names of any containing namespaces), and the
variable is created in the current namespace. If name includes any namespace qualifiers, the variable is created in the specified names-
pace. If the variable is not defined, it will be visible to the namespace which command, but not to the info exists command.
If the variable command is executed inside a Tcl procedure, it creates local variables linked to the corresponding namespace variables (and
therefore these variables are listed by info vars.) In this way the variable command resembles the global command, although the global
command only links to variables in the global namespace. If any values are given, they are used to modify the values of the associated
namespace variables. If a namespace variable does not exist, it is created and optionally initialized.
A name argument cannot reference an element within an array. Instead, name should reference the entire array, and the initialization value
should be left off. After the variable has been declared, elements within the array can be set using ordinary set or array commands.
EXAMPLES
Create a variable in a namespace:
namespace eval foo {
variable bar 12345
}
Create an array in a namespace:
namespace eval someNS {
variable someAry
array set someAry {
someName someValue
otherName otherValue
}
}
Access variables in namespaces from a procedure:
namespace eval foo {
proc spong {} {
# Variable in this namespace
variable bar
puts "bar is $bar"
# Variable in another namespace
variable ::someNS::someAry
parray someAry
}
}
SEE ALSO
global(n), namespace(n), upvar(n)
KEYWORDS
global, namespace, procedure, variable
Tcl 8.0 variable(n)