windows - Want an AWK that implements '@include' -
in gawk manual have describes @include operator. lets make .awk modules , share scripts, etc. include files.
so far latest cgywin, mingw , gnu awk-s (awk, gawk, mawk, nawk, ...) i've found windows fail on first: @include statement.
can point me version implements whole nawk or awk implementation windows? pretty sure there @ least 1 nawk, in day, had downloaded run windows nt.
alternately work around helpful in meantime. (say pre-tested awk includer program??)
tia, will
as far can tell, @include
files not supported natively gawk until 4.x. however, @ least on linux, ships shell script called igawk
can use instead; preprocesses awk scripts , replaces @include
s contents of included file (found via $awkpath
). perhaps cygwin has script?
$ cat foo.awk @include bar.awk $ cat bar.awk begin {print "hello, world!" } $ awk -f foo.awk awk: foo.awk:1: @include bar.awk awk: foo.awk:1: ^ invalid char '@' in expression $ gawk -f foo.awk gawk: foo.awk:1: @include bar.awk gawk: foo.awk:1: ^ invalid char '@' in expression $ igawk -f foo.awk hello, world!
note, however, igawk
, gawk 4's @include
syntaxes not compatible. native @include
in gawk 4 requires quoted string included filename; igawk
's takes bareword, , try find file quotation marks in name if quote it.
Comments
Post a Comment