z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Increment and decrement operators

z/OS UNIX System Services User's Guide
SA23-2279-00

You can advance the value held in a variable, with:
count = count + 1
This is such a common operation that awk has a special operator for incrementing variables by 1.
++
The ++ operator increments the current value of the variable by 1. For example:
count++
adds 1 to the current value of count.
–␠–
The –␠– decrements (subtracts 1 from) the current value of a variable. For example, to subtract 1 from count, write:
count--

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014