/usr/share/doc/runawk/examples/demo_tokenre2 is in runawk 1.5.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #!/usr/bin/env runawk
#use "tokenre.awk"
# This demo splits input line into tokens according to regexp that
# defines lexem of hypotetic programming language.
# Input files for this demo: examples/demo_tokenre2.in*
BEGIN {
TRE = "if|then|else|while|do|end"
TRE = TRE "|" "[0-9]+([.][0-9]+)?"
TRE = TRE "|" ":=|=|<|>|!=|[+]|-|[*]|/|[.][.]"
TRE = TRE "|" "[()]"
TRE = TRE "|" "[[:alpha:]_][[:alnum:]_]*"
TRE = TRE "|" "'[^']*'"
}
{
for (i=1; i <= NF; ++i){
print $i
}
print "<NL>"
}
|