I'm working in the shell, trying to find NUL chars in a bunch of CSV files (that Python's CSV importer is whinging about, but that's for another time) using the so-proud-of-my-ever-clever-self:
find ~/path/ -name "*.csv" -print0 | \
xargs -n 1 -0 \
perl -ne 'if(m/\x{00}/){print fileno(ARGV).join(" ",@ARGV).$_;}'
Except I see no filename. Allegedly the implicit <> operator that perl -ne
is wrapping my script in is just using @ARGV
/ the ARGV
filehandle, but neither of the above is giving me the name of the current file.
How do I see the current filename (and, ideally, line number) in the above?