Typing and Comparison (The GNU Awk User’s Guide)
From Get docs
Gawk/docs/latest/Typing-and-Comparison
Next: Boolean Ops, Previous: Truth Values, Up: Truth Values and Conditions [Contents][Index]
6.3.2 Variable Typing and Comparison Expressions
The Guide is definitive. Reality is frequently inaccurate.
— Douglas Adams, The Hitchhiker’s Guide to the Galaxy
Unlike in other programming languages, in awk
variables do not have a fixed type. Instead, they can be either a number or a string, depending upon the value that is assigned to them. We look now at how variables are typed, and how awk
compares variables.
• Variable Typing | String type versus numeric type. | |
• Comparison Operators | The comparison operators. | |
• POSIX String Comparison | String comparison with POSIX rules. |