My awk executable is not printing FILENAME...: why?

Hello, there!

I am running an executable awk script with ' source.awk input_file ' and found that when I need to print FILENAME, or ENVIRON["AWKPATH"] or even FNR nothing happens [except for an empty line]...
However, if I run it with ' awk -f source.awk input_file ', then those variables are printed...
What is the reason for that behaviour?
Thanking you in advance.

Duplicate of My awk executable is not printing FILENAME...: why?.
Closed.

1 Like