Unix and Linux Discussions Tagged with variable |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
13,596 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
63,567 |
Shell Programming and Scripting |
|
|
|
5 |
23,028 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
11,659 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
8,101 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
14,412 |
Shell Programming and Scripting |
|
|
|
4 |
7,617 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
17,304 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
14,123 |
Programming |
|
|
|
6 |
5,558 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
9,168 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
6,421 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
19,388 |
Shell Programming and Scripting |
|
|
|
3 |
6,213 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
34,827 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
8,326 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
5,582 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
10,207 |
Shell Programming and Scripting |
|
|
|
3 |
16,932 |
Shell Programming and Scripting |
|
|
|
13 |
22,919 |
Programming |
|
|
|
2 |
13,142 |
Shell Programming and Scripting |
|
|
|
3 |
5,493 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
10,492 |
Shell Programming and Scripting |
|
|
|
1 |
19,505 |
Homework & Coursework Questions |
|
|
|
2 |
8,172 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,961 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
15,445 |
Shell Programming and Scripting |
|
|
|
2 |
6,205 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
6,680 |
Shell Programming and Scripting |
|
|
|
3 |
7,341 |
Shell Programming and Scripting |
|
|
|
7 |
11,387 |
UNIX for Beginners Questions & Answers |
|
|
|
9 |
7,441 |
Shell Programming and Scripting |
|
|
|
6 |
7,939 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
9,072 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
14,556 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,122 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
13,008 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
5,710 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,210 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
7,532 |
UNIX for Beginners Questions & Answers |
incr(3tcl) Tcl Built-In Commands incr(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
incr - Increment the value of a variable
SYNOPSIS
incr varName ?increment?
_________________________________________________________________
DESCRIPTION
Increments the value stored in the variable whose name is varName. The value of the variable must be an integer. If increment is supplied
then its value (which must be an integer) is added to the value of variable varName; otherwise 1 is added to varName. The new value is
stored as a decimal string in variable varName and also returned as result.
Starting with the Tcl 8.5 release, the variable varName passed to incr may be unset, and in that case, it will be set to the value incre- |
ment or to the default increment value of 1.
EXAMPLES
Add one to the contents of the variable x:
incr x
Add 42 to the contents of the variable x:
incr x 42
Add the contents of the variable y to the contents of the variable x:
incr x $y
Add nothing at all to the variable x (often useful for checking whether an argument to a procedure is actually integral and generating an
error if it is not):
incr x 0
SEE ALSO
expr(3tcl)
KEYWORDS
add, increment, variable, value
Tcl incr(3tcl)