Is there a way to make awk (gawk) ignore or skip missing files? That is, files passed on the command line that no longer exist in the file system (e.g. rapidly appearing/disappearing files under /proc/[1-9]*).
By default, a missing file is a fatal error :-(
I would like to be able to do the equivalent of something like this:
BEGIN { MISSING_FILES_ARE_FATAL = 0 } # <- Wishful thinking!
{ count++ }
END { print count }
A wrapper script cannot check that files exist befor awk is run as they may disappear between the time they are checked and awk then tries to open them, i.e., it is a race condition. (It is also a race condition to check-and-then-open within awk, although the timing is tighter)