Operation | Operators | Example | Meaning |
---|---|---|---|
assignment | = += | a += 2 | a = a + 2 |
logical OR | || | a || b | 1 if a or b is true, 0 otherwise |
logical AND | && | a && b | 1 if a and b are true, 0 otherwise |
array membership | in | j in a | 1 if a[j] exists, 0 otherwise |
string matching | ~ !~ | $1 ~ /go/ | match if the 1st field contains go |
relational | < <= == != >= > | a == b | 1 if a is equal to b, 0 otherwise |
concatenation | "x" + "z" | "xz" | add, subtract |
+ - | a + b | sum of a and b | multiply, divide |
* / | a * b | product of a and b | |
field | $ | $n+1 | value of the nth field plus 1 |
grouping | ( ) | (AB) + C | matches ABC, ABABC, ... |