课程: AWK Essential Training

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Working with operators and arrays

Working with operators and arrays - Linux教程

课程: AWK Essential Training

Working with operators and arrays

- [Instructor] Like most programming languages, AWK uses operators, the same ones as the C programming language, to perform mathematical and comparison operations. Plus and minus, multiplication, asterisk, and division, slash, work as you'd expect. The modulo operator gives the remainder after dividing the first argument by the second. The power operator, caret, gives the result of raising the first argument to the second one's power. For example, 2^3 = 8. The increment operator, ++, increases the numeric value of its argument, which must be a modifiable variable, by one. For example, if the value of a is three, a++ increases it to four. Similarly, the decrement operator, --, decreases the value by one. For example, if a is three, a-- decreases it to two. These operators can be used before or after the argument, which both have the same effect on the argument, but return a different value if used in an expression.…

内容