Unix and Linux Discussions Tagged with variable |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
8,736 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
54,657 |
Shell Programming and Scripting |
|
|
|
5 |
16,700 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
6,645 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
4,610 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
13,185 |
Shell Programming and Scripting |
|
|
|
4 |
4,808 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
11,754 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
9,908 |
Programming |
|
|
|
6 |
2,905 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
5,708 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,282 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
17,508 |
Shell Programming and Scripting |
|
|
|
3 |
3,921 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
27,534 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
4,694 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
3,680 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
8,510 |
Shell Programming and Scripting |
|
|
|
3 |
14,431 |
Shell Programming and Scripting |
|
|
|
13 |
16,873 |
Programming |
|
|
|
2 |
11,192 |
Shell Programming and Scripting |
|
|
|
3 |
3,322 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
8,667 |
Shell Programming and Scripting |
|
|
|
1 |
15,669 |
Homework & Coursework Questions |
|
|
|
2 |
4,983 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,936 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
12,363 |
Shell Programming and Scripting |
|
|
|
2 |
3,974 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
5,024 |
Shell Programming and Scripting |
|
|
|
3 |
5,663 |
Shell Programming and Scripting |
|
|
|
7 |
7,490 |
UNIX for Beginners Questions & Answers |
|
|
|
9 |
6,068 |
Shell Programming and Scripting |
|
|
|
6 |
5,319 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
5,886 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
9,501 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
1,492 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
8,260 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
3,878 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,691 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
5,691 |
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)