I'd like to execute an gawk script with --re-interval
using a shebang. The "naive" approach of
#!/usr/bin/gawk --re-interval -f
... awk script goes here
does not work, since gawk is called with the first argument "--re-interval -f"
(not splitted around the whitespace), which it does not understand. Is there a workaround for that?
Of course you can either not call gawk directly but wrap it into a shell script that splits the first argument, or make a shell script that then calls gawk and put the script into another file, but I was wondering if there was some way to do this within one file.
The behaviour of shebang lines differs from system to system - at least in Cygwin it does not split the arguments by whitespaces. I just care about how to do it on a system that behaves like that; the script is not meant to be portable.
--re-interval
is not needed anymore (see [gnu.org/software/gawk/manual/…). – user1461760