[Home]
HomePage RecentChanges Frequently Asked Questions

assign

The assignment operator

In awk, as with most other programming languages, the *equals sign* acts as a [[dyadic?]] *assignment operator* assigning the value of the [[expression?]] of the right hand [[operand?]] to the variable named by the left [[operand?]]:

Assignment of variables

The following examples show the use of the equals sign for the assignment of variables:

 fruit = "apple" # assign a string to a variable
 count = 5 # assign a numeric value to a variable

Multiple assignments

The awk language supports multiple assignments as follows:

 x = y = z = 3

Edit this page View other revisions Administration
Last edited 2010年11月28日 18:17 UTC by markhobley (diff)

Powered by sdf Creative Commons License <pierre.gaston+awk@gmail.com>

Awk Wiki by #awk is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

AltStyle によって変換されたページ (->オリジナル) /