Unix and Linux Discussions Tagged with variable |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
13,276 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
63,316 |
Shell Programming and Scripting |
|
|
|
5 |
22,729 |
UNIX for Advanced & Expert Users |
|
|
|
7 |
11,434 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
7,912 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
14,392 |
Shell Programming and Scripting |
|
|
|
4 |
7,465 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
16,965 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
13,882 |
Programming |
|
|
|
6 |
5,407 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
8,942 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
6,294 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
19,337 |
Shell Programming and Scripting |
|
|
|
3 |
6,083 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
34,484 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
8,101 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
5,451 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
10,182 |
Shell Programming and Scripting |
|
|
|
3 |
16,876 |
Shell Programming and Scripting |
|
|
|
13 |
22,644 |
Programming |
|
|
|
2 |
13,123 |
Shell Programming and Scripting |
|
|
|
3 |
5,372 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
10,463 |
Shell Programming and Scripting |
|
|
|
1 |
19,279 |
Homework & Coursework Questions |
|
|
|
2 |
7,959 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,848 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
15,401 |
Shell Programming and Scripting |
|
|
|
2 |
6,071 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
6,661 |
Shell Programming and Scripting |
|
|
|
3 |
7,326 |
Shell Programming and Scripting |
|
|
|
7 |
11,151 |
UNIX for Beginners Questions & Answers |
|
|
|
9 |
7,423 |
Shell Programming and Scripting |
|
|
|
6 |
7,829 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
8,870 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
14,347 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,035 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
12,805 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
5,618 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,108 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
7,418 |
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)