limitation

Limitations of awk

Some traditional versions of awk derived from [[Unix?]] version 7, may not conform to [[posix?]] and may have the following operational limitations:

Whitespace is not allowed before the opening parenthesis in a user function call

Do not leave white space before the opening parenthesis in a user function call. This is not allowed by [[posix?]], and some versions of awk may reject this.

Programs containing only BEGIN actions may read and discard input

It is a requirement of [[posix?]] that if a program contains only BEGIN actions, and contains no instances of getline, then the program should simply execute the actions without reading input. However, traditional awk implementations may read and discard input in this case. It may be necessary to redirect input from the [[null_device?]] to work around this problem:

awk 'BEGIN {print "Hello world!"}' </dev/null