Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning AWK Programming

You're reading from  Learning AWK Programming

Product type Book
Published in Mar 2018
Publisher Packt
ISBN-13 9781788391030
Pages 416 pages
Edition 1st Edition
Languages
Author (1):
Shiwang Kalkhanda Shiwang Kalkhanda
Profile icon Shiwang Kalkhanda

Table of Contents (11) Chapters

Preface Getting Started with AWK Programming Working with Regular Expressions AWK Variables and Constants Working with Arrays in AWK Printing Output in AWK AWK Expressions AWK Control Flow Statements AWK Functions GNU's Implementation of AWK – GAWK (GNU AWK) Practical Implementation of AWK

Relational expressions

Relational expressions are built using relational operators, also known as conditional or comparison operators. These operators are used to test conditions, like if or while. Relational expressions compare strings or numbers for relationships such as equality, greater than , less than, and so on.

These expressions return 1 if the condition evaluates to true and 0 if false. When comparing operands of different types, numeric operands are converted to strings using a built-in variable (using CONVFMT). Strings are compared character to character.

Equal to (==):

This relational operator is represented by the equals symbol repeated twice (==). It returns true if both operands are equal; otherwise it returns false. Here, we have to make sure not to mistype the == operator by forgetting to put one = character. In this case, the AWK code still remains valid but...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}