Have you ever needed to give awk multiple files to process, but wanted it to skip files that it can’t open? Use this snippet!
BEGINFILE {
# skip files that cannot be opened
if ( ERRNO != "" ) {
nextfile
}
}
This trick is mentioned in the documentation for the BEGINFILE pattern, but not spelled out as code. You’re welcome. 😀