set(n) Tcl Built-In Commands set(n)
__________________________________________________________________________________________________________________________________________________NAME
set - Read and write variables
SYNOPSIS
set varName ?value?
_________________________________________________________________DESCRIPTION
Returns the value of variable varName. If value is specified, then set the value of varName to value, creating a new variable if one
doesn't already exist, and return its value. If varName contains an open parenthesis and ends with a close parenthesis, then it refers to
an array element: the characters before the first open parenthesis are the name of the array, and the characters between the parentheses
are the index within the array. Otherwise varName refers to a scalar variable. Normally, varName is unqualified (does not include the
names of any containing namespaces), and the variable of that name in the current namespace is read or written. If varName includes names-
pace qualifiers (in the array name if it refers to an array element), the variable in the specified namespace is read or written.
If no procedure is active, then varName refers to a namespace variable (global variable if the current namespace is the global namespace).
If a procedure is active, then varName refers to a parameter or local variable of the procedure unless the global command was invoked to
declare varName to be global, or unless a variable command was invoked to declare varName to be a namespace variable.
SEE ALSO
expr(n), proc(n), trace(n), unset(n)
KEYWORDS
read, write, variable
Tcl set(n)
Check Out this Related Man Page
set(n) Tcl Built-In Commands set(n)
__________________________________________________________________________________________________________________________________________________NAME
set - Read and write variables
SYNOPSIS
set varName ?value?
_________________________________________________________________DESCRIPTION
Returns the value of variable varName. If value is specified, then set the value of varName to value, creating a new variable if one
doesn't already exist, and return its value. If varName contains an open parenthesis and ends with a close parenthesis, then it refers to
an array element: the characters before the first open parenthesis are the name of the array, and the characters between the parentheses
are the index within the array. Otherwise varName refers to a scalar variable. Normally, varName is unqualified (does not include the
names of any containing namespaces), and the variable of that name in the current namespace is read or written. If varName includes names-
pace qualifiers (in the array name if it refers to an array element), the variable in the specified namespace is read or written.
If no procedure is active, then varName refers to a namespace variable (global variable if the current namespace is the global namespace).
If a procedure is active, then varName refers to a parameter or local variable of the procedure unless the global command was invoked to
declare varName to be global, or unless a variable command was invoked to declare varName to be a namespace variable.
SEE ALSO
expr(n), proc(n), trace(n), unset(n)
KEYWORDS
read, write, variable
Tcl set(n)
I have a problem I don't understand... I am trying to declare a variable, and then output the results of that variable, couldn't be simpler
#!/bin/ksh
VAR='Oranges'
if
then
echo "Found Lemons"
elif
then
echo "Found Oranges"
fi
The output shouold clearly be "Found Oranges", but... (2 Replies)
I have a variable with a value of "05". When I add one to that variable, using the command: CURR_YY=`expr $CURR_YY + 1`, I get the value of "6", losing the leading zero (which is needed for passing to another script). How do I keep the leading zero?
Thank you! (10 Replies)
Hi folks. Can someone tell me how I would declare a variable that has an OR statement. For example under date variable I want a OR:
#!/usr/bin/ksh
date=$((05 | 06 | 07))
CURRDATE=$(date +%d)
if ]
then
echo true
else
echo false
fi (4 Replies)
Hi ,
I need to get the specified word from the variable.can some one help me out in this ?
input=ASD34567P
i need to get the value as :
output1=34567
So i need to ignore the last character and get the remaining values.
THANKS IN ADVANCE. (6 Replies)
Hi
I need to read a value of the variable into array so each character/digit will become an array element,for example:
A=147921231432545436547568678679870
The resulting array should hold each digit as an element.
Thanks a lot for any help -A (7 Replies)
how do i turn on the option to check for opening and closing parenthesis in Microsoft VC++? I remember there is a setting somewhere in the options in the MS VC++ environment but not sure..
thanks (4 Replies)
I need to cut the last seven characters of a variable length variable. The variable may be 7 characters or 70. I need to always be able to grab the last 7 characters. I looked at the cut command but it always seems to want to start at the beginning of a line, not the end and count backwards.
... (5 Replies)
Hi All,
The issue is that for changing name of the file i'm writing a script, there the at one point i need to declare a variable some thing like 'var1, var2, var3 ......' which has to store some value.
Script as follows:
for i in `echo xxxx_dddd_ccc_plsql_zz.sql |tr "_" ' '`
do
... (2 Replies)
Dear all,
I have problem with string variable, I want to write script which do the following
read x
x="part1=part2"
then I want to sub the x variable for
x1="part1"
and
x2="part2"
Is that possible ?? (4 Replies)
Hi gurus,
I need to create arrays from variables, via a loop.
The issue I have is with the array name creation. How do I use a variable to define an array?
I want to do something like
declare -a $H
where $H is my loop variable.
I then need to add items to each array I've created,... (3 Replies)
Hi all,
I used to set variable by read from keyboard
read -p 'Input new value for variable :' var
Now I want to pipe from ls and set to var
a.txt b.txt c.txt
ls | grep a.txt | read var
why this cannot set the $var.
What is the different between them....:wall: (4 Replies)
Hi,
I have table in sql ..from this table im storing the first coloumn values in shell array variable ...
after this passing this variable as an arugument in SQL procedure.
But the proc. is running fine only for 1024 values in array ...
How to store more than 1024 values in the array... (5 Replies)
Hej guys,
I am trying to read a csv file line by line, save it's fields as variables per line so I can use them as parameters and execute stuff.
I am new to shell scripting and was just strictly following a tutorial. Somehow my version seems to ignore the loop. Any help?
TY! :)
#!/bin/bash... (12 Replies)