Hi
I want to do the following:
1. Create a number of Gloabla varibale "ROUTE_IP_xx" based on a counter. As xx sould be from 1-10.
ie ROUTE_IP_1
ROUTE_IP_2
.
.
ROUTE_IP_10
2. I want to initalize all of these variable to 0.0.0.0
ie ROUTE_IP_1='0.0.0.0'
3. I... (2 Replies)
hi
i have a function
abc()
{
a=1
b=2
c=3
}
Now i want to assign these values to the variables out side the function
k=a
l=b
m=c
please help (4 Replies)
Hi,
I am exporting the environment variable from config file, but when I echo the variable it does not display any value. Here is the snippet of the code
#!/bin/sh
export ENVIRONMENT_ROOT_DIRECTORY="/cb/$ENVIRONMENT"
echo $ENVIRONMENT_ROOT_DIRECTORY
${JAVA_HOME}/bin/java... (2 Replies)
I am working on garbage collector in C?
How should :confused: I find the part of heap where the variable are stored. It there any compiler (GCC) support for this. (2 Replies)
how to read the variable from config file
eg: a.cfg below config file config file which contain
a=`hostname`
b=250
a.sh is shell script
echo "$a and $b"
if i run "a.sh 1.cfg" it works
but when i declare N number of variable it wont works..
can u please suggest for that ? (1 Reply)
I have a script with few pre defined variables.
Also have a config file. Something like this.
# config file
# Define Oracle User
MOD1_TAG=abcde
MOD2_TAG=xyzabc
MOD3_TAG=def
I need to parse the config file and have each of the value copied to different variables.
Please suggest what... (1 Reply)
how to read the variable indivdually ( line by line ) in shell script
eg :
i have the config file where contain
cat /home/user01/ilap/conf/input.conf
node.txt
node2.txt
node3.txt
i need to run script like
/home/user01/ilap/exe/run.sh /home/user01/ilap/conf/input.conf
... (1 Reply)
I am using . .profile in my script below
I want to fech it it from my configuration file .id_pass_file.txt(it has all user_name and passwords)
how can i do this
PROFILE_PATH=. .profile
AND IN MY SCRIPT
$PROFILE_PATH
IS THIS CORRECT
#!/bin/sh
ORACLE_HOME=/var/opt/oracle/product/10g;... (8 Replies)
Discussion started by: rafa_fed2
8 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)