awk:awk_math_operations
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
awk:awk_math_operations [2021/01/06 15:21] – peter | awk:awk_math_operations [2022/06/13 09:45] (current) – [Advanced Example Using a Variable] peter | ||
---|---|---|---|
Line 20: | Line 20: | ||
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
Line 29: | Line 29: | ||
</ | </ | ||
- | | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
+ | ---- | ||
AWK supports the full range of arithmetic operators including: | AWK supports the full range of arithmetic operators including: | ||
Line 52: | Line 55: | ||
===== Using a Variable ===== | ===== Using a Variable ===== | ||
- | |||
- | Issue the following command: | ||
<code awk> | <code awk> | ||
- | awk ' | + | awk ' |
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
Line 68: | Line 69: | ||
</ | </ | ||
- | This assigns a variable named x. | + | <WRAP info> |
+ | **NOTE: | ||
It has shown a running total and calculated an overall total of 47 items. | It has shown a running total and calculated an overall total of 47 items. | ||
+ | |||
+ | </ | ||
---- | ---- | ||
===== Advanced Example Using a Variable ===== | ===== Advanced Example Using a Variable ===== | ||
- | |||
- | Issue the following command: | ||
<code awk> | <code awk> | ||
- | awk ' | + | awk ' |
</ | </ | ||
- | which will display something like: | + | returns: |
< | < | ||
Line 91: | Line 93: | ||
</ | </ | ||
- | This procedure gives a listing of each record while assigning a total value and keeping a running balance. | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
---- | ---- | ||
awk/awk_math_operations.1609946464.txt.gz · Last modified: 2021/01/06 15:21 by peter