O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The switch statement (a GAWK-specific feature)

The switch statement is a GAWK specific feature which is not available in the default AWK program. It allows the evaluation of an expression and the execution of statements if case match. The case statements are checked for a match in the order they are specified. If none of the preceding given case statement match is found, then the default section is executed.

The first switch expression is evaluated and then the output of expression the is compared with the value given with the case statement. Each case statement contains a value that could be a numeric, string, or regular expression. The type of constant determines the comparison with switch expression result. Type of comparison performed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required