I'm familiar that DD command doesn't produce output while running. However, if I send a USR1 signal to it, it can print current state.
Can I do the same with AWK? Prints its variables, register signal_handler?
You can't rely on this behavior across platforms, even for
dd. POSIX doesn't specify a response to SIGUSR1, and indeed your
dd process will die if you try it on OSX or BSD, or even sometimes on embedded Linux (Busybox). Using
dd in this way appears to be a GNU extension. In practice, on most desktop Linux systems you'll be able to do this.
Similarly, if you're using GNU
awk, you may be able to send it a
SIGUSR1 to get some GNU-specific internal state info. In this case it doesn't print to stdout, but to a file. Awk versions that support this are GNU
awk 4.1.0 and later if run with the
--profile) flag, or 3.1 and later when compiled and run as
Note that it's less certain that your desktop Linux is running GNU awk than GNU
mawk is another awk I've seen running on desktop Linux.