Name

@

Synopsis

        @ variable = expression
        @ variable[n] = expression
        @

Assign the value of the arithmetic expression to variable, or to the nth element of variable if the index n is specified. With no variable or expression specified, print the values of all shell variables (same as set). Expression operators as well as examples are listed under the section "Expressions,” earlier in this chapter. Two special forms are also valid:

@ variable ++
@ variable [ n ]++

Increment variable or element by 1.

@ variable --
@ variable [ n ]--

Decrement variable or element by 1.

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.