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

Calling user-defined functions

A function call consists of the function name followed by the arguments of the function in parentheses. Whitespace characters (spaces and tabs) are not allowed between the function name and opening parenthesis of the argument list.

In the previous function example, the func1.awk main function is called inside the BEGIN block by simply putting main(). The main function, in turn, has other function calls with their arguments, such as fund_add(num1,num2), find_sub(num1,num2), and find_mul(num1,num2).

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