My program prints the even lines of every file in the current directory:
for file in . *
do
awk 'NR % 2 == 0' "$file"
done
I would like it to print the name of the file followed by a colon before every line in the output. I can't find a way to insert anything while the awk command is doing it's job. Is it impossible to do this using awk? Thank you in advance for any suggestions.