Extended string functions. Extensions to the standard string functions
and new string functions
allow you to match and substitute for subpatterns within patterns
(similar to gawk's gensub() function), assign to substrings within
strings, and split a string into an array based on a pattern that
matches elements, instead of the separator. There are additional
printf formats, and string translation functions.
While undoubtedly some of these functions could be written as
user-defined functions, having them built in provides greater performance.
Bit manipulation functions. You can perform bitwise AND, OR, and XOR
operations on (integer) values.
These could also be written as user-defined functions, but with a loss
of performance.
More I/O functions. There is a suite of functions modeled after those
in the stdio(3) library. In particular, the ability to seek within
a file, and do I/O in fixed-size amounts, is quite useful.
Directory operation functions. You can make, remove, and change directories,
as well as remove and rename files.
File information functions. You can retrieve file permissions, size, and
modification times.
Directory reading functions. You can get the current directory name,
as well as read a list of all the filenames in a directory.
Time functions. There are functions to retrieve the current time of day,
and format it in various ways. These functions are not quite as flexible
as gawk's strftime() function.
Execution functions. You can sleep for a specific amount of time, and
start other functions running. Tawk's spawn() function is
interesting because it allows you to provide values for the new
program's environment, and also indicate whether the program should or
should not run asynchronously.
This is particularly valuable on non-UNIX systems, where the command
interpreters (such as MS-DOS's command.com) are quite limited.
File locking. You can lock and unlock files and ranges within files.
Screen functions. You can do screen-oriented I/O. Under UNIX,
these functions are implemented on top of the curses(3) library.
Packing and unpacking of binary data. You can specify how binary data
structures are laid out. This, together with the new I/O functions, makes
it possible to do binary I/O, something you would normally have to do in C
or C++.
Access to internal state. You can get or set the value of any awk variable
through function calls.
Access to MS-DOS low-level facilities. You can use system interrupts,
and peek and poke values at memory addresses. These features are
obviously for experts only.
From this list, it becomes clear that tawk provides a nice alternative
to C and to Perl for serious programming tasks.
As an example, the
screen functions and internal state functions are used to
implement the tawk debugger in awk.