Awk version of makeobjops.PL.
Note the invocation ordering is slightly different:
	awk -f makeobjops.awk foo.m -ch

Submitted by:	Oliver Fromme <olli@fromme.com>

error: pathspec 'sys/tools/makeobjops.awk' did not match any file(s) known to git

--- sys/tools/makeobjops.awk
+++ sys/tools/makeobjops.awk
@@ -0,0 +1,485 @@
+#!/usr/bin/awk -f
+#
+# Copyright (c) 1992, 1993
+#        The Regents of the University of California.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+#        This product includes software developed by the University of
+#        California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+#    may be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# From @(#)vnode_if.sh        8.1 (Berkeley) 6/10/93
+# From @(#)makedevops.sh 1.1 1998/06/14 13:53:12 dfr Exp $
+# From @(#)makedevops.sh ?.? 1998/10/05
+# From src/sys/kern/makedevops.pl,v 1.12 1999/11/22 14:40:04 n_hibma Exp
+# From src/sys/kern/makeobjops.pl,v 1.8 2001/11/16 02:02:42 joe Exp
+#
+# $FreeBSD$
+
+#
+#   Script to produce kobj front-end sugar.
+#
+
+function usage ()
+{
+	print "usage: makeobjops.awk <srcfile.m> [-d] [-p] [-l <nr>] [-c|-h]";
+	print "where -c   produce only .c files";
+	print "      -h   produce only .h files";
+	print "      -p   use the path component in the source file for destination dir";
+	print "      -l   set line width for output files [80]";
+	print "      -d   switch on debugging";
+	exit 1;
+}
+
+function warn (msg)
+{
+	print "makeobjops.awk:", msg > "/dev/stderr";
+}
+
+function warnsrc (msg)
+{
+	warn(src ":" lineno ": " msg);
+}
+
+function debug (msg)
+{
+	if (opt_d)
+		warn(msg);
+}
+
+function die (msg)
+{
+	warn(msg);
+	exit 1;
+}
+
+#   These are just for convenience ...
+function printc(s) {if (opt_c) print s > ctmpfilename;}
+function printh(s) {if (opt_h) print s > htmpfilename;}
+
+#
+#   If a line exceeds maxlength, split it into multiple
+#   lines at commas.  Subsequent lines are indented by
+#   the specified number of spaces.
+#
+#   In other words:  Lines are split by replacing ", "
+#   by ",\n" plus indent spaces.
+#
+
+function format_line (line, maxlength, indent)
+{
+	rline = "";
+
+	while (length(line) > maxlength) {
+		#
+		#   Find the rightmost ", " so that the part
+		#   to the left of it is just within maxlength.
+		#   If there is none, give up and leave it as-is.
+		#
+		if (!match(substr(line, 1, maxlength + 1), /^.*, /))
+			break;
+		rline = rline substr(line, 1, RLENGTH - 1) "\n";
+		line = sprintf("%*s", indent, "") substr(line, RLENGTH + 1);
+	}
+	return rline line;
+}
+
+#
+#   Join an array into a string.
+#
+
+function join (separator, array, num)
+{
+	_result = ""
+	if (num) {
+		while (num > 1)
+			_result = separator array[num--] _result;
+		_result = array[1] _result;
+	}
+	return _result;
+}
+
+#
+#   Execute a system command and report if it failed.
+#
+
+function system_check (cmd)
+{
+	if ((rc = system(cmd)))
+		warn(cmd " failed (" rc ")");
+}
+
+#
+#   Handle "INTERFACE" line.
+#
+
+function handle_interface ()
+{
+	intname = $2;
+	sub(/;$/, "", intname);
+	if (intname !~ /^[a-z_][a-z0-9_]*$/) {
+		debug($0);
+		warnsrc("Invalid interface name '" intname "', use [a-z_][a-z0-9_]*");
+		error = 1;
+		return;
+	}
+	if (!/;[ 	]*$/)
+		warnsrc("Semicolon missing at end of line, no problem");
+
+	debug("Interface " intname);
+
+	printh("#ifndef _" intname "_if_h_");
+	printh("#define _" intname "_if_h_\n");
+	printc("#include \"" intname "_if.h\"\n");
+}
+
+#
+#   Handle "CODE" and "HEADER" sections.
+#   Returns the code as-is.
+#
+
+function handle_code ()
+{
+	code = "\n";
+	getline < src;
+	indent = $0;
+	sub(/[^	 ].*$/, "", indent);	# find the indent used
+	while (!/^}/) {
+		sub("^" indent, "");	# remove the indent
+		code = code $0 "\n";
+		getline < src;
+		lineno++;;
+	}
+	return code;
+}
+
+#
+#   Handle "METHOD" and "STATICMETHOD" sections.
+#
+
+function handle_method (static)
+{
+	#
+	#   Get the return type and function name and delete that from
+	#   the line. What is left is the possibly first function argument
+	#   if it is on the same line.
+	#
+	if (!intname) {
+		warnsrc("No interface name defined");
+		error = 1;
+		return;
+	}
+	sub(/^[^ 	]+[ 	]+/, "");
+	ret = $0;
+	sub(/[ 	]*\{.*$/, "", ret);
+	name = ret;
+	sub(/^.*[ 	]/, "", name);	# last element is name of method
+	sub(/[ 	]+[^ 	]+$/, "", ret);	# return type
+	debug("Method: name=" name " return type=" ret);
+
+	sub(/^[^\{]*\{[	 ]*/, "");
+
+	if (!name || !ret) {
+		debug($0);
+		warnsrc("Invalid method specification");
+		error = 1;
+		return;
+	}
+
+	if (name !~ /^[a-z_][a-z_0-9]*$/) {
+		warnsrc("Invalid method name '" name "', use [a-z_][a-z0-9_]*");
+		error = 1;
+		return;
+	}
+
+	if (methods[name]) {
+		warnsrc("Duplicate method name");
+		error = 1;
+		return;
+	}
+	methods[name] = name;
+
+	line = $0;
+	while (line !~ /\}/ && (getline < src) > 0) {
+		line = line " " $0;
+		lineno++
+	}
+
+	default = "";
+	if (!match(line, /\};?/)) {
+		warnsrc("Premature end of file");
+		error = 1;
+		return;
+	}
+	extra = substr(line, RSTART + RLENGTH);
+	if (extra ~ /[	 ]*DEFAULT[ 	]*[a-zA-Z_][a-zA-Z_0-9]*[ 	]*;/) {
+		default = extra;
+		sub(/.*DEFAULT[	 ]*/, "", default);
+		sub(/[; 	]+.*$/, "", default);
+	}
+	else if (extra && opt_d) {
+		#   Warn about garbage at end of line.
+		warnsrc("Ignored '" extra "'");
+	}
+	sub(/\};?.*$/, "", line);
+
+	#
+	#   Create a list of variables without the types prepended.
+	#
+	sub(/^[	 ]+/, "", line);	# remove leading ...
+	sub(/[ 	]+$/, "", line);	# ... and trailing whitespace
+	gsub(/[	 ]+/, " ", line);	# remove double spaces
+
+	num_arguments = split(line, arguments, / *; */) - 1;
+	delete varnames;		# list of varnames
+	num_varnames = 0;
+	for (i = 1; i <= num_arguments; i++) {
+		if (!arguments[i])
+			continue;	# skip argument if argument is empty
+		num_ar = split(arguments[i], ar, /[* 	]+/);
+		if (num_ar < 2) {	# only 1 word in argument?
+			warnsrc("no type for '" arguments[i] "'");
+			error = 1;
+			return;
+		}
+		#   Last element is name of variable.
+		varnames[++num_varnames] = ar[num_ar];
+	}
+
+	argument_list = join(", ", arguments, num_arguments);
+	varname_list = join(", ", varnames, num_varnames);
+
+	if (opt_d) {
+		warn("Arguments: " argument_list);
+		warn("Varnames: " varname_list);
+	}
+
+	mname = intname "_" name;	# method name
+	umname = toupper(mname);	# uppercase method name
+
+	firstvar = varnames[1];
+
+	if (default == "")
+		default = "0";
+
+	# the method description
+	printh("extern struct kobjop_desc " mname "_desc;");
+	# the method typedef
+	prototype = "typedef " ret " " mname "_t(";
+	printh(format_line(prototype argument_list ");",
+	    line_width, length(prototype)));
+
+	# Print out the method desc
+	printc("struct kobjop_desc " mname "_desc = {");
+	printc("\t0, (kobjop_t) " default);
+	printc("};\n");
+
+	# Print out the method itself
+	if (0) {		# haven't chosen the format yet
+		printh("static __inline " ret " " umname "(" varname_list ")");
+		printh("\t" join(";\n\t", arguments, num_arguments) ";");
+	}
+	else {
+		prototype = "static __inline " ret " " umname "(";
+		printh(format_line(prototype argument_list ")",
+		    line_width, length(prototype)));
+	}
+	printh("{");
+	printh("\tkobjop_t _m;");
+	if (!static)
+		firstvar = "((kobj_t)" firstvar ")";
+	printh("\tKOBJOPLOOKUP(" firstvar "->ops," mname ");");
+	retrn =  (ret != "void") ? "return " : "";
+	printh("\t" retrn "((" mname "_t *) _m)(" varname_list ");");
+	printh("}\n");
+}
+
+#
+#   Begin of the main program.
+#
+
+BEGIN {
+
+line_width = 80;
+gerror = 0;
+
+#
+#   Process the command line.
+#
+
+num_files = 0;
+
+for (i = 1; i < ARGC; i++) {
+	if (ARGV[i] ~ /^-/) {
+		#
+		#   awk doesn't have getopt(), so we have to do it ourselves.
+		#   This is a bit clumsy, but it works.
+		#
+		for (j = 2; j <= length(ARGV[i]); j++) {
+			o = substr(ARGV[i], j, 1);
+			if	(o == "c")	opt_c = 1;
+			else if	(o == "h")	opt_h = 1;
+			else if	(o == "p")	opt_p = 1;
+			else if	(o == "d")	opt_d = 1;
+			else if	(o == "l") {
+				if (length(ARGV[i]) > j) {
+					opt_l = substr(ARGV[i], j + 1);
+					break;
+				}
+				else {
+					if (++i < ARGC)
+						opt_l = ARGV[i];
+					else
+						usage();
+				}
+			}
+			else
+				usage();
+		}
+	}
+	else if (ARGV[i] ~ /\.m$/)
+		filenames[num_files++] = ARGV[i];
+	else
+		usage();
+}
+
+if (!num_files || !(opt_c || opt_h))
+	usage();
+
+if (opt_p)
+	debug("Will produce files in original not in current directory");
+
+if (opt_l) {
+	if (opt_l !~ /^[0-9]+$/ || opt_l < 1)
+		die("Invalid line width '" opt_l "'");
+	line_width = opt_l;
+	debug("Line width set to " line_width);
+}
+
+for (i = 0; i < num_files; i++)
+	debug("Filename: " filenames[i]);
+
+for (file_i = 0; file_i < num_files; file_i++) {
+	src = filenames[file_i];
+	cfilename = hfilename = src;
+	sub(/\.m$/, ".c", cfilename);
+	sub(/\.m$/, ".h", hfilename);
+	if (!opt_p) {
+		sub(/^.*\//, "", cfilename);
+		sub(/^.*\//, "", hfilename);
+	}
+
+	debug("Processing from " src " to " cfilename " / " hfilename);
+
+	ctmpfilename = cfilename ".tmp";
+	htmpfilename = hfilename ".tmp";
+
+	common_head = \
+	    "/*\n" \
+	    " * This file is produced automatically.\n" \
+	    " * Do not modify anything in here by hand.\n" \
+	    " *\n" \
+	    " * Created from source file\n" \
+	    " *   " src "\n" \
+	    " * with\n" \
+	    " *   makeobjops.awk\n" \
+	    " *\n" \
+	    " * See the source file for legal information\n" \
+	    " */\n";
+
+	printc(common_head "\n" \
+	    "#include <sys/param.h>\n" \
+	    "#include <sys/queue.h>\n" \
+	    "#include <sys/kernel.h>\n" \
+	    "#include <sys/kobj.h>");
+
+	printh(common_head);
+
+	delete methods;		# clear list of methods
+	intname = "";
+	lineno = 0;
+	error = 0;		# to signal clean up and gerror setting
+
+	while (!error && (getline < src) > 0) {
+		lineno++;
+
+		#
+		#   Take special notice of include directives.
+		#
+		if (/^#[ 	]*include[ 	]+["<][^">]+[">]/) {
+			incld = $0;
+			sub(/^#[ 	]*include[ 	]+/, "", incld);
+			debug("Included file: " incld);
+			printc("#include " incld);
+		}
+
+		sub(/#.*/, "");		# remove comments
+		sub(/^[	 ]+/, "");	# remove leading ...
+		sub(/[ 	]+$/, "");	# ... and trailing whitespace
+
+		if (/^$/) {		# skip empty lines
+		}
+		else if (/^INTERFACE[ 	]+[^ 	;]*[ 	]*;?[ 	]*$/)
+			handle_interface();
+		else if (/^CODE[ 	]*{$/)
+			printc(handle_code());
+		else if (/^HEADER[	 ]*{$/)
+			printh(handle_code());
+		else if (/^METHOD/)
+			handle_method(0);
+		else if (/^STATICMETHOD/)
+			handle_method(1);
+		else {
+			debug($0);
+			warnsrc("Invalid line encountered");
+			error = 1;
+		}
+	}
+
+	#
+	#   Print the final '#endif' in the header file.
+	#
+	printh("#endif /* _" intname "_if_h_ */");
+
+	close (ctmpfilename);
+	close (htmpfilename);
+
+	if (error) {
+		warn("Output skipped");
+		system_check("rm -f " ctmpfilename " " htmpfilename);
+		gerror = 1;
+	}
+	else {
+		if (opt_c)
+			system_check("mv " ctmpfilename " " cfilename);
+		if (opt_h)
+			system_check("mv " htmpfilename " " hfilename);
+	}
+}
+
+exit gerror;
+
+}


Add script to convert old submission format to new format.

error: pathspec 'tools/data/submission_old_to_new.awk' did not match any file(s) known to git

--- tools/data/submission_old_to_new.awk
+++ tools/data/submission_old_to_new.awk
@@ -0,0 +1,9 @@
+#!/usr/bin/env awk -f
+
+{
+    for (i = 1; i <= NF; i++) {
+        if (i == 3) printf "-1 ";
+        printf $i" "
+    }
+    printf "\n"
+}


add httpd.awk for http test

add httpd.awk for http test

error: pathspec 'httpd.awk' did not match any file(s) known to git

--- httpd.awk
+++ httpd.awk
@@ -0,0 +1,18 @@
+#!/usr/bin/gawk -f
+# httpd.awk
+# original from http://dqn.sakusakutto.jp/2013/08/awk_http_server.html
+BEGIN {
+    port = "8080";
+    http_service = "/inet/tcp/" port "/0/0";
+    RS = ORS = "\r\n";
+
+    for (;;) {
+        if ((http_service |& getline) > 0) {
+            print "HTTP/1.x 200 OK"         |& http_service;
+            print "Content-type: text/html" |& http_service;
+            print ""                        |& http_service;
+            print "
Hello, world!
"  |& http_service;
+        }
+        close(http_service);
+    }
+}


Modify script to get is all sorted out.

Modify script to get is all sorted out.

error: pathspec 'scripts/tdb/statuses_gln_auids.awk' did not match any file(s) known to git

--- scripts/tdb/statuses_gln_auids.awk
+++ scripts/tdb/statuses_gln_auids.awk
@@ -0,0 +1,117 @@
+#!/usr/bin/awk -f
+#tdbout -t publisher,plugin,publisher:info[tester],status,year *.tdb
+#           #1        #2      #3                     #4    #5
+#tdbout -t publisher,plugin,auid,publisher:info[tester],status,year *.tdb
+#           #1        #2      #3   #4                     #5     #6
+
+BEGIN {
+  FS="\t"
+  pn = 0
+    #str = "date +%m-%d-%Y";
+    #str | getline date;
+    #close str;
+}
+
+{
+  # add a loop to add line only if either [status is _not_ manifest] OR [journal_year (or journal end year) is gt or eq to 2010 && journal year (or journal end year) is lt or eq to the current year we are testing]
+  current_year = 2016
+  end_year = 0
+  incontract = 0
+  test_year = ""
+  test_year = 2010
+  if (length($6) > 3) {
+    end_year = substr($6,length($6)-3,4)
+  }
+  #printf "%s\n", $0
+  if (($5 != "manifest") || ((end_year >= test_year) && (end_year <= current_year))) {
+    incontract = 1
+  }
+
+  if (incontract == 1) {
+    #split up the plugin. nn=number of fields. na is the name of the array.
+    nn = split($2,na,/\./)
+    #save the last element into 1p2.
+    lp2 = na[nn]
+    p[pn] = $1        #publisher
+    n[pn] = lp2       #plugin
+    auid[pn] = $3     #auid
+    status[pn] = $5   #status
+    r[pn] = $4        #tester
+    if (r[pn] == "") {
+      if ((substr(p[pn],1,2) <= "Mz")) {
+        r[pn] = "5"
+      } else if (substr(p[pn],1,2) >= "NA") {
+        r[pn] = "8"
+      }
+    }
+    pn++
+    x[$5]++
+    tt++
+  }
+}
+
+END {
+  s[0] = "expected"
+  s[1] = "exists"
+  s[2] = "manifest"
+  s[3] = "wanted"
+  s[4] = "testing"
+  s[5] = "notReady"
+  s[6] = "ready"
+  s[7] = "released"
+  s[8] = "down"
+  s[9] = "superseded"
+  s[10] = "doNotProcess"
+  s[11] = "doesNotExist"
+  sn = 12
+
+  sc[0] = "expe"
+  sc[1] = "exis"
+  sc[2] = "mani"
+  sc[3] = "want"
+  sc[4] = "test"
+  sc[5] = "notR"
+  sc[6] = "read"
+  sc[7] = "rele"
+  sc[8] = "down"
+  sc[9] = "supe"
+  sc[10] = "doNP"
+  sc[11] = "dNoE"
+  scn = 12
+
+  #print out header
+  printf "Publisher\tPlugin\tAUid\tT\tTotal\tStatus"
+  #for (j = 0 ; j < scn ; j++) {
+  #  if (x[s[j]] > 0) {
+  #  printf "\t%s", sc[j]
+  #  }
+  #}
+  printf "\n"
+
+  #print out publisher, plugin, auid, tester, status
+  for (i = 0 ; i < pn ; i++) {
+    printf "%s\t%s\t%s\t%s\t1", p[i], n[i], auid[i], r[i], status[i]
+    #for (j = 0 ; j < sn ; j++) {
+    #  if (x[s[j]] > 0){
+#   #   if (status[i] == 0) {
+    #  printf "\t.."
+    #} else {
+    #    printf "1"
+    #  }
+    #}
+#    }
+    printf "\n"
+  }
+    #print out bottom line sums
+    printf "Publisher\tPlugin\tAUid\tT\t%d", tt
+    for (j = 0 ; j < sn ; j++) {
+      if (x[s[j]] > 0) {
+        printf "\t%d", x[s[j]]
+      }
+    }
+
+  printf "\n"
+  #printf "%s", date
+  #printf "\n"
+}
+


Add crosscheck of EPISODES with SEASONS

Add crosscheck of EPISODES with SEASONS

error: pathspec 'verifyBBoxInfoFrom-webscraper.awk' did not match any file(s) known to git

--- verifyBBoxInfoFrom-webscraper.awk
+++ verifyBBoxInfoFrom-webscraper.awk
@@ -0,0 +1,45 @@
+# WebScraper has problems getting incomplete data.
+#
+# Crosscheck the info in EPISODES with the info in SEASONS. Count up episodes
+# and compare with the number of episodes listed in the seasons file.
+
+# For now these seem more likely a problem in scraping SEASONS than EPISODES
+# so it could be these are false positives in generating spreadsheets.
+# Problems listed in BBox_anomalies files are more likely to be real.
+
+# INVOCATION
+#    awk -f verifyBBoxInfoFrom-webscraper.awk BBox_episodeInfo-180421.123042.txt
+
+/ movie / {
+    title = $3
+    numEpisodes = $5
+    if (numEpisodes == 0)
+        print
+}
+
+/ show / {
+    numShows += 1
+    showTitle[numShows] = $3
+    shouldHave[numShows] = $5
+    doesHave[numShows] = 0
+    if (numEpisodes == 0)
+        print
+}
+
+/^         / {
+    epis  = NF-1
+    if ($epis !~ /^[[:digit:]]*$/)
+        print "==> Bad input line " NR "\n" $0
+    else
+        doesHave[numShows] += $epis
+}
+
+END {
+    print ""
+    for ( i = 1; i <= numShows; i++ ) {
+        if (shouldHave[i] != doesHave[i]) {
+            print "==> show  "showTitle[i] " has " doesHave[i] " instead of " \
+                shouldHave[i] " episodes."
+        }
+    }
+}


changelog: Added AWK script

changelog: Added AWK script

error: pathspec 'changelog.awk' did not match any file(s) known to git

--- changelog.awk
+++ changelog.awk
@@ -0,0 +1,29 @@
+#!/usr/bin/awk -f
+BEGIN {
+	# Determines whether to print 'Unreleased' banner at top
+	UNRELEASED_COMMITS = 1
+	# Prefixes that determine whether a commit will be printed
+	CHANGELOG_REGEX = "^(changelog|fix|docs|chore|feat): "
+	FS="|"
+	while ("git log --pretty='%D|%s|%H'" | getline) {
+		IS_GIT_TAG = length($1) && match($1, /tag:/)
+		if (IS_GIT_TAG) {
+			UNRELEASED_COMMITS = 0
+			# Cut out text up to tag
+			sub(/.*tag: /, "", $1)
+			# Cut out text after tag
+			sub(/,.*/, "", $1)
+			print $1
+		} else {
+			if ( UNRELEASED_COMMITS ) {
+				print "Unreleased"
+				UNRELEASED_COMMITS = 0
+			}
+			if ( match($2, CHANGELOG_REGEX) ) {
+				sub(CHANGELOG_REGEX, "", $2)
+				printf("\t- %s\n", $2)
+			}
+		}
+
+	}
+}


Turn IMDB scrapes into usable data

Turn IMDB scrapes into usable data

error: pathspec 'getFullcastFrom-imdb.awk' did not match any file(s) known to git

--- getFullcastFrom-imdb.awk
+++ getFullcastFrom-imdb.awk
@@ -0,0 +1,64 @@
+BEGIN {
+    FS = "\t"
+}
+
+{
+    web_scraper_start_url = $1
+    Title = $2
+    Years = $3
+    Cast = $4
+    Directors = $5
+    Writers = $6
+
+    if (Cast == "" && Directors == "" && Writers == "")
+        next
+
+    if (NR == 1)
+        next
+
+    if (Cast != "") {
+        gsub (/[[:blank:]]{3,99}\(uncredited\)/," (uncredited)",Cast)
+        nflds1 = split (Cast,fld,/[[:blank:]]{3,99}/)
+        type = "Actor"
+        person = fld[1]
+        role = fld[3]
+        sub (/\302\240/,"",role)
+        episodes = fld[4]
+        nflds2 = split (episodes,fld,/,/)
+        num_episodes = fld[1]
+        sub (/ episodes?/,"",num_episodes)
+        episode_years = fld[2]
+        sub (/ /,"",episode_years)
+    }
+
+    if (Directors != "") {
+        nflds1 = split (Directors,fld,/[[:blank:]]{3,99}/)
+        type = "Director"
+        role = ""
+        person = fld[1]
+        episodes = fld[3]
+        gsub (/[()]/,"",episodes)
+        nflds2 = split (episodes,fld,/,/)
+        num_episodes = fld[1]
+        sub (/ episodes?/,"",num_episodes)
+        episode_years = fld[2]
+        sub (/ /,"",episode_years)
+    }
+
+    if (Writers != "") {
+        nflds1 = split (Writers,fld,/[[:blank:]]{3,99}/)
+        type = "Writer"
+        role = ""
+        person = fld[1]
+        episodes = fld[3]
+        gsub (/[()]/,"",episodes)
+        nflds2 = split (episodes,fld,/,/)
+        num_episodes = fld[1]
+        sub (/ episodes?/,"",num_episodes)
+        episode_years = fld[2]
+        sub (/ /,"",episode_years)
+    }
+
+    printf ("%d - %s %s\t%s\t%s\t%s\t%s\t%s\n",nflds1,Title,Years,person,type,role,num_episodes,episode_years)
+
+}


- added new symsets script

- added new symsets script

error: pathspec 'scripts/symsets.awk' did not match any file(s) known to git

--- scripts/symsets.awk
+++ scripts/symsets.awk
@@ -0,0 +1,548 @@
+#!/usr/bin/awk -f
+# =============================================================================
+#
+# @(#) $RCSfile: symsets.awk,v $ $Name:  $($Revision: 1.1.2.1 $) $Date: 2011-03-17 07:01:22 $
+#
+# -----------------------------------------------------------------------------
+#
+# Copyright (c) 2008-2011  Monavacon Limited <http://www.monavacon.com/>
+# Copyright (c) 2001-2008  OpenSS7 Corporation <http://www.openss7.com/>
+# Copyright (c) 1997-2001  Brian F. G. Bidulock <bidulock@openss7.org>
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Affero General Public License as published by the Free
+# Software Foundation; version 3 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License along
+# with this program.  If not, see <http://www.gnu.org/licenses/>, or write to
+# the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# -----------------------------------------------------------------------------
+#
+# U.S. GOVERNMENT RESTRICTED RIGHTS.  If you are licensing this Software on
+# behalf of the U.S. Government ("Government"), the following provisions apply
+# to you.  If the Software is supplied by the Department of Defense ("DoD"), it
+# is classified as "Commercial Computer Software" under paragraph 252.227-7014
+# of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any
+# successor regulations) and the Government is acquiring only the license rights
+# granted herein (the license rights customarily provided to non-Government
+# users).  If the Software is supplied to any unit or agency of the Government
+# other than DoD, it is classified as "Restricted Computer Software" and the
+# Government's rights in the Software are defined in paragraph 52.227-19 of the
+# Federal Acquisition Regulations ("FAR") (or any successor regulations) or, in
+# the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR
+# (or any successor regulations).
+#
+# -----------------------------------------------------------------------------
+#
+# Commercial licensing and support of this software is available from OpenSS7
+# Corporation at a fee.  See http://www.openss7.com/
+#
+# -----------------------------------------------------------------------------
+#
+# Last Modified $Date: 2011-03-17 07:01:22 $ by $Author: brian $
+#
+# =============================================================================
+
+function getline_command(cmd)
+{
+    cmd | getline; close(cmd); return $0
+}
+function date(format) {
+    if (format) {
+	return getline_command("date +\"" format "\"")
+    } else {
+	return getline_command("date -uIseconds")
+    }
+}
+function year()
+{
+    return date("%Y")
+}
+function allyears(    this, last, sep, result)
+{
+    last = year(); sep = ""; result = ""
+    for (this = 2009; this <= last; this++) {
+	result = result sep this
+	sep = ", "
+    }
+    return result
+}
+function print_info(string)
+{
+    if (values["quiet"] == 0 && values["verbose"] > 0) {
+	print blu me ": I: " string std > stderr
+	written[stderr] = 1
+    }
+}
+function print_debug(string)
+{
+    if (values["debug"] > 0) {
+	print mag me ": D: " string std > stderr
+	written[stderr] = 1
+    }
+}
+function print_error(string)
+{
+    print red me ": E: " string std > stderr
+    written[stderr] = 1
+}
+function print_warn(string)
+{
+    if (values["quiet"] == 0 || values["verbose"] > 0 || values["debug"] > 0) {
+	print org me ": W: " string std > stderr
+	written[stderr] = 1
+    }
+}
+function usage(output)
+{
+    if (values["quiet"])
+	return
+    print "\
+symsets:\n\
+  $Id: symsets.awk,v 1.1.2.1 2011-03-17 07:01:22 brian Exp $\n\
+Usage:\n\
+  symsets [options] [INPUT ...]\n\
+  symsets -h\n\
+  symsets -V\n\
+  symsets -C\
+" > output
+    written[output] = 1
+}
+function help(output)
+{
+    if (values["quiet"])
+	return
+    usage(output)
+    print "\
+Arguments:\n\
+  INPUT ...\n\
+      Module.symvers files for which to generate symsets\n\
+      [default: " defaults["inputs"] "] {" environs["inputs"] "}\n\
+Options:\n\
+  -s, --suse\n\
+      output symsets in SuSE format\n\
+  -r, --redhat\n\
+      output symsets in RedHat format (default)\n\
+  -k, --kversion KVERSION\n\
+      kernel version KVERSION\n\
+      [default: " defaults["kversion"] "] {" environs["kversion"] "}\n\
+  -I, --inputs INPUTS\n\
+      input Module.symvers files (space separated)\n\
+      [default: " defaults["inputs"] "] {" environs["inputs"] "}\n\
+  -o, --outfile OUTFILE\n\
+      output file name OUTFILE\n\
+      [default: " defaults["outfile"] "] {" environs["outfile"] "}\n\
+  -n, --dryrun, --dry-run\n\
+      don't perform the actions, just check them\n\
+  -q, --quiet, --silent\n\
+      suppress normal output\n\
+  -D, --debug[=LEVEL]\n\
+      increase or set debug level\n\
+      [default: " defaults["debug"] "]\n\
+  -v, --verbose[=LEVEL]\n\
+      increase or set verbosity level\n\
+      [default: " defaults["verbose"] "]\n\
+  -h, --help\n\
+      display this usage information and exit\n\
+  -V, --version\n\
+      display script version and exit\n\
+  -C, --copying\n\
+      display copying permissions and exit\n\
+" > output
+    written[output] = 1
+}
+function version(output)
+{
+    if (values["quiet"])
+	return
+    print "\
+Version 2.1\n\
+$Id: symsets.awk,v 1.1.2.1 2011-03-17 07:01:22 brian Exp $\n\
+Copyright (c) 2008, " allyears() "  Monavacon Limited.\n\
+Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008  OpenSS7 Corporation.\n\
+Copyright (c) 1997, 1998, 1999, 2000, 2001  Brian F. G. Bidulock.\n\
+\n\
+All Rights Reserved.\n\
+\n\
+This is free software; see the source for copying conditions.  There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+\n\
+Distributed by OpenSS7 under GNU Affero General Public License Version 3,\n\
+with conditions, incorporated herein by reference.\n\
+\n\
+See " me " -- --copying' for copying permissions.\
+" > output
+    written[output] = 1
+}
+function copying(output)
+{
+    if (values["quiet"])
+	return
+    print "\
+--------------------------------------------------------------------------------\n\
+$Id: symsets.awk,v 1.1.2.1 2011-03-17 07:01:22 brian Exp $\n\
+--------------------------------------------------------------------------------\n\
+Copyright (c) 2008, " allyears() "  Monavacon Limited.\n\
+Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008  OpenSS7 Corporation.\n\
+Copyright (c) 1997, 1998, 1999, 2000, 2001  Brian F. G. Bidulock.\n\
+\n\
+All Rights Reserved.\n\
+--------------------------------------------------------------------------------\n\
+This program is free software; you can  redistribute  it and/or modify  it under\n\
+the terms  of the  GNU  Affero General Public  License as published  by the Free\n\
+Software Foundation; version 3 of the License.\n\
+\n\
+This program is distributed in the hope that it will  be useful, but WITHOUT ANY\n\
+WARRANTY; without even  the implied warranty of MERCHANTABILITY or FITNESS FOR A\n\
+PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.\n\
+\n\
+You should have received a copy of the  GNU Affero General Public License  along\n\
+with this program.   If not, see <http://www.gnu.org/licenses/>, or write to the\n\
+Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\
+--------------------------------------------------------------------------------\n\
+U.S. GOVERNMENT RESTRICTED RIGHTS.  If you are licensing this Software on behalf\n\
+of the U.S. Government (\"Government\"), the following provisions apply to you. If\n\
+the Software is supplied by the  Department of Defense (\"DoD\"), it is classified\n\
+as \"Commercial  Computer  Software\"  under  paragraph  252.227-7014  of the  DoD\n\
+Supplement  to the  Federal Acquisition Regulations  (\"DFARS\") (or any successor\n\
+regulations) and the  Government  is acquiring  only the  license rights granted\n\
+herein (the license rights customarily provided to non-Government users). If the\n\
+Software is supplied to any unit or agency of the Government  other than DoD, it\n\
+is  classified as  \"Restricted Computer Software\" and the Government's rights in\n\
+the Software  are defined  in  paragraph 52.227-19  of the  Federal  Acquisition\n\
+Regulations (\"FAR\")  (or any successor regulations) or, in the cases of NASA, in\n\
+paragraph  18.52.227-86 of  the  NASA  Supplement  to the FAR (or any  successor\n\
+regulations).\n\
+--------------------------------------------------------------------------------\n\
+Commercial  licensing  and  support of this  software is  available from OpenSS7\n\
+Corporation at a fee.  See http://www.openss7.com/\n\
+--------------------------------------------------------------------------------\
+" > output
+    written[output] = 1
+}
+function getopt_long(argc, argv, optstring, longopts, longindex,    pos, needarg, wantarg)
+{
+    option = ""; optval = ""; optarg = ""; pos = 0; needarg = 0; wantarg = 0
+    if (optind == 0) { optind = 1; more = "" }
+    while ((optind < argc) || (more != "")) {
+	if (more) { arg = "-" more; more = "" }
+	else { arg = argv[optind]; optind++ }
+	if (arg ~ /^--?[a-zA-Z0-9]/) {
+	    if (needarg) {
+		print_error("option -" optval " requires an argument")
+		usage(stderr)
+		exit 2
+	    }
+	    if (wantarg) {
+		more = substr(arg, 2)
+		return optval
+	    }
+	    if (arg ~ /^--[a-zA-Z0-9][-_a-zA-Z0-9]*=.*$/) {
+		option = arg; sub(/^--/, "", option); sub(/=.*$/, "", option)
+		optarg = arg; sub(/^--([a-zA-Z0-9][-_a-zA-Z0-9]*)=/, "", optarg)
+		if (!(option in longopts)) {
+		    print_error("option --" option " not recognized")
+		    usage(stderr)
+		    exit 2
+		}
+		if (longopts[option] !~ /:/) {
+		    print_error("option --" option " does not take an argument")
+		    usage(stderr)
+		    exit 2
+		}
+		optval = substr(longopts[option], 1, 1)
+		return optval
+	    }
+	    if (arg ~ /^--[a-zA-Z0-9][-_a-zA-Z0-9]*$/) {
+		option = arg; sub(/^--/, "", option)
+		if (!(option in longopts)) {
+		    print_error("option --" option " not recognized")
+		    usage(stderr)
+		    exit 2
+		}
+		if (longopts[option] ~ /::/) { wantarg = 1 } else
+		if (longopts[option] ~ /:/ ) { needarg = 1 }
+		optval = substr(longopts[option], 1, 1)
+		for (option in longopts)
+		    if (substr(longopts[option], 1, 1) == optval)
+			break
+		if (!needarg && !wantarg)
+		    return optval
+		continue
+	    }
+	    if (arg ~ /^-[a-zA-Z0-9]/) {
+		optval = substr(arg, 2, 1)
+		pos = index(optstring, optval)
+		if (pos == 0) {
+		    print_error("option -" optval " not recognized")
+		    usage(stderr)
+		    exit 2
+		}
+		if (substr(optstring, pos+1, 1) == ":") {
+		    if (length(arg) > 2) {
+			if (substr(optstring, pos+2, 1) == ":") {
+			    more = substr(arg, 3)
+			    if (more && more !~ /^[a-zA-Z0-9]/) {
+				print_error("bad option sequence " arg)
+				usage(stderr)
+				exit 2
+			    }
+			} else
+			    optarg = substr(arg, 3)
+			for (option in longopts)
+			    if (substr(longopts[option], 1, 1) == optval)
+				break
+			return optval
+		    }
+		    if (substr(optstring, pos+2, 1) == ":") { wantarg = 1 } else
+		    if (substr(optstring, pos+1, 1) == ":") { needarg = 1 }
+		    for (option in longopts)
+			if (substr(longopts[option], 1, 1) == optval)
+			    break
+		    continue
+		}
+		if (length(arg) > 2) { more = substr(arg, 3) } else { more = "" }
+		if (more && more !~ /^[a-zA-Z0-9]/) {
+		    print_error("bad option sequence " arg)
+		    usage(stderr)
+		    exit 2
+		}
+		for (option in longopts)
+		    if (substr(longopts[option], 1, 1) == optval)
+			break
+		return optval
+	    }
+	}
+	if (arg == "--")
+	    return -1
+	if (needarg || wantarg) {
+	    optarg = arg
+	    return optval
+	}
+	optind--
+	return -1
+    }
+    return -1
+}
+function system_command(cmd)
+{
+    print_debug(cmd); return system(cmd)
+}
+function missing(fnlp, expected) {
+    print_error(fnlp " definition missing " (expected - NF) " fields")
+}
+function garbage(fnlp, maximum) {
+    print_warn(fnlp " definition with " (NF - maximum) " garbage fields")
+}
+function unrecog(fnlp, line) {
+    print_error(fnlp " unrecognized line: " line)
+}
+function read_inputs(inputs) {
+    print_debug("reading inputs...")
+    for (k in inputs) {
+	input = inputs[k]
+	print_debug("reading input " input)
+	filename = input
+	lineno = 0
+	while ((getline < input) == 1) {
+	    lineno++; fnl = filename ":" lineno; fnlp = fnl ": "
+	    if (NF < 4) { missing(fnlp, 4); continue }
+	    if (NF > 4) { garbage(fnlp, 4); NF = 4 }
+	    if ($1~/^0x/) {
+		gsub(/\//, "_")
+		if ($3 in symsets) {
+		    symsets[$3] = symsets[$3] " " $2
+		    crcsets[$3] = crcsets[$3] $1
+		} else {
+		    symsets[$3] = $2
+		    crcsets[$3] = $1
+		}
+		# Note that SuSE includes EXPORT type in the
+		# kABI, whereas RedHat does not.
+		if (values["suse"] == 1) {
+		    syms[$2] = $1 "\t" $2 "\t" $3 "\t" $4
+		} else {
+		    syms[$2] = $1 "\t" $2 "\t" $3
+		}
+		#print $1 "\t" $2 "\t" $3
+	    } else { unrecog(fnlp, $0); continue }
+	}
+	close(input)
+    }
+}
+BEGIN {
+    LINT = "yes"
+    me = "symsets.awk"
+    if (!("TERM" in ENVIRON)) ENVIRON["TERM"] = "dumb"
+    if (ENVIRON["TERM"] == "dumb" || system("test -t 1 -a -t 2") != 0) {
+	stdout = "/dev/stderr"; written[stdout] = 0
+	stderr = "/dev/stderr"; written[stderr] = 0
+	cr = ""; lf = "\n"
+	blk = ""; hblk = ""
+	red = ""; hred = ""
+	grn = ""; hgrn = ""
+	org = ""; horg = ""
+	blu = ""; hblu = ""
+	mag = ""; hmag = ""
+	cyn = ""; hcyn = ""
+	std = ""
+    } else {
+	stdout = "/dev/stdout"; written[stdout] = 0
+	stderr = "/dev/stderr"; written[stderr] = 0
+	cr = "\r"; lf = ""
+	blk = "\033[0;30m"; hblk = "\033[1;30m"
+	red = "\033[0;31m"; hred = "\033[1;31m"
+	grn = "\033[0;32m"; hgrn = "\033[1;32m"
+	org = "\033[0;33m"; horg = "\033[1;33m"
+	blu = "\033[0;34m"; hblu = "\033[1;34m"
+	mag = "\033[0;35m"; hmag = "\033[1;35m"
+	cyn = "\033[0;36m"; hcyn = "\033[1;36m"
+	std = "\033[m"
+    }
+    if ("kversion" in ENVIRON) { uname = ENVIRON["kversion"] }
+    else                       { uname = getline_command("uname -r") }
+    longopts["inputs"       ] = "I:" ; environs["inputs"        ] = "MODPOST_MODVER"  ; defaults["inputs"       ] = "Module.symvers"
+    longopts["suse"         ] = "s"  ;                                                  defaults["suse"         ] = 0
+    longopts["redhat"       ] = "r"  ;                                                  defaults["redhat"       ] = 1
+    longopts["kversion"     ] = "k:" ; environs["kversion"      ] = "kversion"        ; defaults["kversion"     ] = uname
+    longopts["outfile"      ] = "o:" ; environs["outfile"       ] = "MODPOST_SYMSETS" ; defaults["outfile"      ] = "symsets-" uname ".tar.gz"
+    longopts["dryrun"       ] = "n"  ;                                                  defaults["dryrun"       ] = 0
+    longopts["dry-run"      ] = "n"  ;                                                  defaults["dry-run"      ] = 0
+    longopts["quiet"        ] = "q"  ;                                                  defaults["quiet"        ] = 0
+    longopts["silent"       ] = "q"  ;                                                  defaults["silent"       ] = 0
+    longopts["debug"        ] = "D::";                                                  defaults["debug"        ] = 0
+    longopts["verbose"      ] = "v::";                                                  defaults["verbose"      ] = 0
+    longopts["help"         ] = "h"  ;
+    longopts["version"      ] = "V"  ;
+    longopts["copying"      ] = "C"  ;
+    # set mandatory defaults
+    values["suse"         ] = defaults["suse"    ]
+    values["redhat"       ] = defaults["redhat"  ]
+    values["kversion"     ] = defaults["kversion"]
+    values["inputs"       ] = defaults["inputs"  ]
+    values["outfile"      ] = defaults["outfile" ]
+    values["debug"        ] = defaults["debug"   ]
+    values["verbose"      ] = defaults["verbose" ]
+    values["quiet"        ] = defaults["quiet"   ]
+    if ("V" in ENVIRON && ENVIRON["V"] == 1) {
+	values["quiet"  ] = 0
+	values["verbose"] = 2
+    }
+    optstring = "I:srk:o:nqD::v::hVC"
+    optind = 0
+    while (1) {
+	c = getopt_long(ARGC, ARGV, optstring, longopts)
+	if (c == -1) break
+	else if (c ~ /[Iko]/)  { values[option] = optarg }
+	else if (c ~ /[srnq]/) { values[option] = 1 }
+	else if (c == "D")     { if (optarg) { values["debug"  ] = optarg } else { values["debug"  ]++ } }
+	else if (c == "v")     { if (optarg) { values["verbose"] = optarg } else { values["verbose"]++ } }
+	else if (c == "h")     { help(   stdout); exit 0 }
+	else if (c == "V")     { version(stdout); exit 0 }
+	else if (c == "C")     { copying(stdout); exit 0 }
+	else                   { usage(  stderr); exit 2 }
+    }
+    if (optind < ARGC) {
+	values["inputs"] = ARGV[optind]; optind++
+	while (optind < ARGC) {
+	    values["inputs"] = values["inputs"] " " ARGV[optind]
+	    optind++
+	}
+    }
+    for (i=1;ARGC>i;i++) { delete ARGV[i] }
+    for (value in values) {
+	if (!values[value] && (value in environs) && (environs[value] in ENVIRON) && ENVIRON[environs[value]]) {
+	    print_debug("assigning value for " value " from environment " environs[value])
+	    values[value] = ENVIRON[environs[value]]
+	}
+	if (!values[value] && (value in defaults) && defaults[value]) {
+	    print_debug("assigning value for " value " from default " defaults[value])
+	    values[value] = defaults[value]
+	}
+    }
+    if (values["suse"] == 1) { values["redhat"] = 0 }
+    if (!values["inputs"] || values["inputs"] == "-") {
+	print_debug("no inputs, using " stdin)
+	values["inputs"] = stdin
+    }
+    split(values["inputs"], inputs)
+    read_inputs(inputs)
+    directory = values["outfile"]
+    sub(/\.tar\.gz/, "", directory)
+    tarball = directory ".tar.gz"
+    dirname  = getline_command("dirname "  directory)
+    basename = getline_command("basename " directory)
+    if (dirname == ".") { chngdir = "" } else { chngdir = " -C " dirname }
+    system_command("mkdir -p " directory)
+    if (system("test -f " tarball) == 0) {
+	print_debug("unpacking tarball " tarball)
+	system_command("tar -xzf " tarball chngdir)
+    }
+
+    print_debug("processing symbols")
+    for (symset in symsets) {
+	print_debug("processing symbol set " symset)
+	if (values["redhat"] == 1) {
+	    # note that RedHat does not protect the symbol name,
+	    # the location of the symbol within the kernel, nor
+	    # the export type in the kABI, whereas SuSE does.
+	    $0 = getline_command("echo '" crcsets[symset] "' | sha1sum")
+	    hash = $1
+	    print_debug("hash is: '" hash "'")
+	} else {
+	    hash = "tmp"
+	}
+	print_debug("removing " directory "/" symset ".*")
+	system_command("rm -f -- " directory "/" symset ".*")
+	file = directory "/" symset "." hash
+	print_debug("creating " file)
+	n = split(symsets[symset],symbols)
+	n = asort(symbols)
+	for (i=1;i<=n;i++) {
+	    sym = symbols[i]
+	    print syms[sym] > file
+	}
+	close(file)
+	if (hash == "tmp") {
+	    hash = getline_command("md5sum " file)
+	    hash = substr(hash, 1, 16)
+	    print_debug("hash is: '" hash "'")
+	    print_debug("moving " file " to " directory "/" symset "." hash)
+	    system_command("mv -f -- " file " " directory "/" symset "." hash)
+	}
+    }
+    print_debug("done processing symbols")
+    print_debug("creating " tarball)
+    system_command("tar -czf " tarball chngdir " " basename)
+    print_debug("removing working directory " directory)
+    system_command("rm -fr -- " directory)
+    exit 0
+}
+END {
+    if (written[stdout]) {
+	close(stdout)
+	written[stdout] = 0
+    }
+    if (written[stderr]) {
+	close(stderr)
+	written[stderr] = 0
+    }
+}
+
+# =============================================================================
+#
+# $Log: symsets.awk,v $
+# Revision 1.1.2.1  2011-03-17 07:01:22  brian
+# - added new symsets script
+#
+#
+# =============================================================================
+# vim: ft=awk sw=4 nocin nosi fo+=tcqlorn


Create parseOui.awk

Create parseOui.awk

error: pathspec 'parseOui.awk' did not match any file(s) known to git

--- parseOui.awk
+++ parseOui.awk
@@ -0,0 +1,60 @@
+#!/usr/bin/awk -f
+
+#####
+##
+##      DATE: 2015-04-11
+##    AUTHOR: Emile Mercier
+##   PURPOSE: Parse oui.txt into a associative array
+##            with the key being the entire manufacturer string.
+##            for use during compiling randomac.c
+##
+##     NOTE: after running this on oui.txt, it becomes obvious that the data is
+##           not normalized.
+##
+##           For example, look at this output:
+##              2wire>--001FB3 00217C 0022A4 002351 002456 00253C 002650 28162E 34EF44 383BC8 3CEA4F
+##              2wire inc>------60C397 94C150
+##              2wire inc.>-----001D5A
+##              2wire, inc>-----000D72 001288 00183F 0019E4 001AC4
+##              2wire, inc.>----001495 001B5B 001EC7 00D09E
+##
+##           sloppy :(
+##
+##
+##    USAGE: parseOui.awk oui.txt
+
+# take action only the lines matching "base 16" in oui.txt
+/base 16/ {
+    count+=1;
+    mfgString=""
+
+    # store the base 16 mac prefix in an array named MacPrefix
+    MacPrefix[count] = sprintf("%s", $1);
+
+    # store the entire manufacturer name in the variable mfgString
+    # I did this in awk but sed or cut in shell is what i'd rather do.
+    # "from here to end of line" in awk is pretty ugly
+    for (i=4; i<=NF; ++i) {
+        # if condition is so that mfgString doesn't have a preceeding space
+        if ( i == 4)
+            mfgString = sprintf("%s",$i);
+        else
+            mfgString = sprintf("%s %s", mfgString, sprintf("%s",$i) );
+    }
+
+    # Store the manufacturer string "mfgString" in a associative array "Manuf"
+    # as the "primary key"
+    # each mac prefix associated with the literal manufacturer string
+    # is then stored, space delimited, in it.
+    # The if condition is so that first mac prefix entry isn't preceeded by a space
+    if ( Manuf[ tolower(mfgString) ] == "" )
+        Manuf[ tolower(mfgString) ] = sprintf("%s", MacPrefix[count]);
+    else
+        Manuf[ tolower(mfgString) ] = sprintf("%s %s",Manuf[ tolower(mfgString) ],MacPrefix[count]);
+}
+
+END{
+   for (i in Manuf)
+       printf( "%s\t%s\n", i, Manuf[i] );
+}
+


perf.awk: logs performance meter

perf.awk: logs performance meter

error: pathspec 'awk/perf.awk' did not match any file(s) known to git


2008-03-14  Martin Sebor  <sebor@roguewave.com>

	* bin/xcomp.awk (get_gzlogfname): Replaced .txt suffix with
	the hopefully now correct .gz.txt.

git-svn-id: 8ce9432b95a2a271c6c279131eb1bb968a8ee7fb@637303 13f79535-47bb-0310-9956-ffa450edef68

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pathscale/stdcxx.git/'


Add parser for Z3's get-model output.

Add parser for Z3's get-model output.

Doesn't really parse it, it just reformats it into something less
rubbish.

error: pathspec 'z3_parse.awk' did not match any file(s) known to git


2008-04-15  Martin Sebor  <sebor@roguewave.com>

	* bin/xcomp.awk: Added comments describing how platform pattern
	matching works for the expected failures feature.
	Prepended 'X' to the signal name when the signal is expected
	to match the legend at the bottom of the page.

git-svn-id: 8ce9432b95a2a271c6c279131eb1bb968a8ee7fb@648374 13f79535-47bb-0310-9956-ffa450edef68


add trim.awk

add trim.awk

error: pathspec 'lips/trim.awk' did not match any file(s) known to git

--- lips/trim.awk
+++ lips/trim.awk
@@ -0,0 +1,28 @@
+#!/usr/bin/awk -f
+
+#+block usage
+
+# ### `trim.awk`: trim blank lines
+# ```
+# usage: trim.awk FILENAME
+# ```
+
+# Trim blank lines in FILENAME
+
+#+endblock
+
+BEGIN {
+    n = 0
+}
+
+{
+    lines[n++] = $0
+}
+
+END {
+    for (start=0; start<n && lines[start]~/^\s*$/; start++);
+    for (end=n-1; end>=0 && lines[end]~/^\s*$/; end--);
+    for (i=start; i<=end; i++) {
+        print lines[i];
+    }
+}


Added 99 Bottles Problem in AWK

Added 99 Bottles Problem in AWK

error: pathspec '99_Bottles_Problem/AWK/wasi0013/99Bottles.awk' did not match any file(s) known to git

--- 99_Bottles_Problem/AWK/wasi0013/99Bottles.awk
+++ 99_Bottles_Problem/AWK/wasi0013/99Bottles.awk
@@ -0,0 +1,20 @@
+func bottle(){
+  bottles = 99;
+  while(bottles > 0){
+    printf("%d bottles of beer on the wall, %d bottles of beer.\n",bottles,bottles);
+    bottles--;
+    print("Take one down and pass it around,",(bottles > 0) ?bottles:"no more" ,"bottles of beer on the wall.");
+  }
+  print("No more bottles of beer on the wall, no more bottles of beer.");
+  print("Go to the store and buy some more, 99 bottles of beer on the wall.");
+}
+
+
+
+BEGIN {
+    // run the program
+	bottle();
+}
+END {
+
+}


reverted experimental mawk

reverted experimental mawk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/orbifx/yamado.git/'


display more conventional date format in html pages


gnumake2: added missing processdelivered.awk script

error: pathspec 'solenv/gbuild/processdelivered.awk' did not match any file(s) known to git

--- solenv/gbuild/processdelivered.awk
+++ solenv/gbuild/processdelivered.awk
@@ -0,0 +1,36 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+BEGIN {
+    RS=" "
+    FS=":"
+}
+
+NF == 2 {
+    print "COPY " $1 " " $2;
+}
+


adding awk script to read winners from stdout.txt

error: pathspec 'Tensile/Source/winners.awk' did not match any file(s) known to git


Calculate durations

Calculate durations

error: pathspec 'calculateBBoxDurations.awk' did not match any file(s) known to git

--- calculateBBoxDurations.awk
+++ calculateBBoxDurations.awk
@@ -0,0 +1,65 @@
+# Total the duration of episodes in every series
+# Update the number of episodes and the total show duration for any that are missing
+# NOTE: Depends on file being sorted in reverse order
+
+# INVOCATION:
+#       grep -hv ^Sortkey $PROGRAMS_SPREADSHEET_FILE $EPISODES_SPREADSHEET_FILE | sort -f |
+#           tail -r | awk -v ERROR_FILE=$ERROR_FILE -v DURATION_FILE=$DURATION_FILE \
+#           -f calculateBBoxDurations.awk | tail -r >>$LONG_SPREADSHEET_FILE
+
+# Field numbers
+#    1 Sortkey    2 Title    3 Seasons    4 Episodes    5 Duration    6 Year(s)    7 Rating
+
+BEGIN {
+    FS = "\t"
+    OFS = "\t"
+}
+
+# No processing on header and other lines unrelated to shows
+$1 == "" || $1 == "Sortkey" {
+    print
+    next
+}
+
+# Accumulate total time on any line that has a valid duration
+$5 != "" {
+    # Check all durations for strict HH:MM:SS format
+    if ($5 !~ /^[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}$/) {
+        print "==> Bad duration " $5 " in " $0 >> ERROR_FILE
+        print
+        next
+    } else {
+        split ($5, tm, ":")
+        totalTime[3] += tm[3]
+        totalTime[2] += tm[2] + int(totalTime[3] / 60)
+        totalTime[1] += tm[1] + int(totalTime[2] / 60)
+        totalTime[3] %= 60; totalTime[2] %= 60
+    }
+}
+
+# (2) indicates an episode, which should always have a valid duration
+# Accumulate series time and episode count on any line that has a valid duration
+$1 ~ / \(2\) / {
+        secs += tm[3]
+        mins += tm[2] + int(secs / 60)
+        hrs += tm[1] + int(mins / 60)
+        secs %= 60; mins %= 60
+        episodes += 1
+        print
+}
+
+# (1) indicates a show, which may or may not have a duration
+# If it has no duration, update it from the running total
+$1 ~ / \(1\) / {
+    if ($5 == "") {
+        $4 = episodes
+        $5 = sprintf ("%02d:%02d:%02d", hrs, mins, secs)
+        secs = 0; mins = 0; hrs = 0;
+        episodes = 0
+    }
+    print
+}
+
+END {
+    printf ("%02d:%02d:%02d\n", totalTime[1], totalTime[2], totalTime[3]) >> DURATION_FILE
+}


Little awk test

Little awk test

error: pathspec 'test2.awk' did not match any file(s) known to git


Add tool to populate options for configure

error: pathspec 'tool/configure.awk' did not match any file(s) known to git

--- tool/configure.awk
+++ tool/configure.awk
@@ -0,0 +1,23 @@
+BEGIN { OFS = "=" }
+$1 == "--bindir" { print $0,BINDIR }
+$1 == "--datadir" { print $0,DATADIR }
+$1 == "--datarootdir" { print $0,DATAROOTDIR }
+$1 == "--docdir" { print $0,DOCDIR }
+$1 == "--dvidir" { print $0,DVIDIR }
+$1 == "--dynlibdir" { print $0,DYNLIBDIR }
+$1 == "--htmldir" { print $0,HTMLDIR }
+$1 == "--includedir" { print $0,INCLUDEDIR }
+$1 == "--infodir" { print $0,INFODIR }
+$1 == "--libdir" { print $0,LIBDIR }
+$1 == "--libexecdir" { print $0,LIBEXECDIR }
+$1 == "--localedir" { print $0,LOCALEDIR }
+$1 == "--localstatedir" { print $0,LOCALSTATEDIR }
+$1 == "--mandir" { print $0,MANDIR }
+$1 == "--oldincludedir" { print $0,OLDINCLUDEDIR }
+$1 == "--pdfdir" { print $0,PDFDIR }
+$1 == "--psdir" { print $0,PSDIR }
+$1 == "--sbindir" { print $0,SBINDIR }
+$1 == "--sharedstatedir" { print $0,SHAREDSTATEDIR }
+$1 == "--srcdir" { print $0,SRCDIR }
+$1 == "--sysconfdir" { print $0,SYSCONFDIR }
+$1 == "--sysdepdir" { print $0,SYSDEPDIR }


END has to be last with Sun's awk

END has to be last with Sun's awk

git-svn-id: 193148810cf65385f3a195dbc9a8b504846da3a2@9772 ec53bebd-3082-4978-b11e-865c3cabbd6b

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/madscientist159/heimdal.git/'


MONDRIAN-LAGUNITAS: checkFile: Allow long string literal on line starting with '?' or ':'.

[git-p4: depot-paths = "//open/mondrian-release/lagunitas/": change = 14917]

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/citycloud-bigdata/mondrian.git/'


add correct_energy.awk

add correct_energy.awk

error: pathspec 'tool.hgas/correct_energy.awk' did not match any file(s) known to git

--- tool.hgas/correct_energy.awk
+++ tool.hgas/correct_energy.awk
@@ -0,0 +1,6 @@
+{
+    if($10<0.) {
+        $10 *= -1;
+    }
+    print $0;
+}


chinese block

chinese block

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/idevz/life.git/'


add tool.imbh/print_dumpparticle.awk

add tool.imbh/print_dumpparticle.awk

error: pathspec 'tool.imbh/print_dumpparticle.awk' did not match any file(s) known to git

--- tool.imbh/print_dumpparticle.awk
+++ tool.imbh/print_dumpparticle.awk
@@ -0,0 +1,3 @@
+{
+    printf("            dumpOneParticle(%10d, sph);\n", $1);
+}


make-barcodes.awk: New script for code creating barcodes from sequences.

error: pathspec 'make-barcodes.awk' did not match any file(s) known to git

--- make-barcodes.awk
+++ make-barcodes.awk
@@ -0,0 +1,40 @@
+BEGIN {
+  FS = "\t"; OFS = "\t";
+  if (! BAR_LEN) {
+    BAR_LEN = 24;
+  }
+  if (! INVARIANT) {
+    INVARIANT = 5;
+  }
+  HALF = int(BAR_LEN/2);
+  # Fill an array mapping each character to its ASCII value.
+  for (i = 0; i < 128; i++) {
+    char = sprintf("%c", i);
+    ORD[char] = i;
+  }
+}
+function get_sum(seq) {
+  sum = 0;
+  for (i = 1; i <= length(seq); i++) {
+    sum += ORD[substr(seq, i, 1)];
+  }
+  return sum;
+}
+{
+  alpha = substr($2, 1, HALF);
+  beta = substr($6, 1, HALF);
+  alpha_sum = get_sum(alpha);
+  beta_sum = get_sum(beta);
+  if (alpha_sum < beta_sum) {
+    barcode = alpha beta;
+    order = "ab";
+  } else {
+    barcode = beta alpha;
+    order = "ba";
+  }
+  read1 = substr($2, HALF + INVARIANT + 1);
+  read2 = substr($6, HALF + INVARIANT + 1);
+  # $1 = read1 name | $4 = read1 quality | $5 = read2 name | $8 = read2 quality
+  print barcode, order, $1, read1, $4, $5, read2, $8;
+}
+


Add awk solution to problem 16

Add awk solution to problem 16

error: pathspec 'MPRT/MPRT.awk' did not match any file(s) known to git

--- MPRT/MPRT.awk
+++ MPRT/MPRT.awk
@@ -0,0 +1,39 @@
+#!/usr/bin/awk -f
+
+{
+    protein = ""
+    flag = 0    # Get rid of line with label
+    while (("curl -Ls http://www.uniprot.org/uniprot/"$1".fasta" | getline prot_line) > 0) {
+        if (flag)
+            # Append line to protein
+            protein = protein prot_line
+        else
+            # We're on the first line - ignore label and set flag
+            flag = 1
+    }
+
+    first = 1    # Print label only once
+    startidx = 1
+    do {
+        where = match(substr(protein, startidx), /N[^P][ST][^P]/)
+        if (where != 0) {
+            if (first) {
+                # Print label, start location string
+                print $0
+                loc_string = where + startidx - 1
+                # Reset flag
+                first = 0
+            }
+            else {
+                # Append to location string
+                loc_string = loc_string " " where + startidx - 1
+            }
+            # Update offset: start one after start of last match
+            startidx += where
+        }
+    } while (where != 0)
+
+    # Did we find something?
+    if (loc_string)
+        print loc_string
+}


Add a crosscheck for the SEASONS_SORTED_FILE

error: pathspec 'crosscheckInfo.awk' did not match any file(s) known to git

--- crosscheckInfo.awk
+++ crosscheckInfo.awk
@@ -0,0 +1,43 @@
+# Crosscheck the number of episodes of each show found by counting them (grep -c)
+# in EPISODES_SORTED_FILE versus the number added up from SEASONS_SORTED_FILE
+# Both numbers are found by processing a checkEpisodeInfo file
+#
+# For now these seem more likely a problem in scraping SEASONS_SORTED_FILE than EPISODES_SORTED_FILE
+# so it could be these are false positives in generating spreadsheets. The case is stronger for
+# problems listed in checkBBox_anomalies files.
+
+# INVOCATION:
+#    awk -f crosscheckInfo.awk checkEpisodeInfo-180415.185805.txt
+
+/ movie / {
+    title = $3
+    numEpisodes = $5
+    if (numEpisodes == 0)
+        print
+}
+
+/ show / {
+    numShows += 1
+    showTitle[numShows] = $3
+    shouldHave[numShows] = $5
+    doesHave[numShows] = 0
+    if (numEpisodes == 0)
+        print
+}
+
+/^         / {
+    epis  = NF-1
+    if ($epis !~ /^[[:digit:]]*$/)
+        print "==> Bad input line " NR "\n" $0
+    else
+        doesHave[numShows] += $epis
+}
+
+END {
+    for ( i = 1; i <= numShows; i++ ) {
+        if (shouldHave[i] != doesHave[i]) {
+            print "==> show  "showTitle[i] " has " doesHave[i] " instead of " \
+                shouldHave[i] " episodes."
+        }
+    }
+}


tools: remove old updateAuthors.awk script

Using the new tools/update-authors.sh script so this is
redundant

PR-URL: https://github.com/iojs/io.js/pull/582
Reviewed-By: Ben Noordhuis <59bd0a3ff43b32849b319e645d4798d8a5d1e889@bnoordhuis.nl>

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/dreamllq/node.git/'


asplit.awk now 1-base numbering, for the need of kaldi's run.pl

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/cybeliak/mispronounceableness.git/'


Add AWK script to merge comma-terminated lines

error: pathspec 'mergelines.awk' did not match any file(s) known to git

--- mergelines.awk
+++ mergelines.awk
@@ -0,0 +1,25 @@
+#!/usr/bin/awk -f
+#
+# AWK script to join multiple lines if the preceeding line ends with a comma (,).
+#
+# For example:
+#
+#   1,
+#   2,
+#   3
+#
+# Turns into:
+#
+#   1, 2, 3
+#
+
+/,$/ {
+    ORS=""
+    print $0
+    do {
+        getline
+        print $0
+    } while ($0 ~ /,$/)
+    ORS="\n"
+    print ""
+}


Create signal_clean.awk

Create signal_clean.awk

A clean baseline reference for data processing comparisons

error: pathspec 'signal_clean.awk' did not match any file(s) known to git


Create signal_data.awk

Create signal_data.awk

A simple awk script for generating noisy signal data for testing the linear_regression code.

error: pathspec 'signal_data.awk' did not match any file(s) known to git


added missing file

added missing file

error: pathspec 'fa2sql.awk' did not match any file(s) known to git

--- fa2sql.awk
+++ fa2sql.awk
@@ -0,0 +1,23 @@
+BEGIN {
+	s = -1;
+	if (table == "")
+		table = "sequences";
+	if (create_table == 1)
+		printf("DROP TABLE IF EXISTS %s; CREATE TABLE %s ( otu VARCHAR(32) PRIMARY KEY, sequence LONGTEXT );", table, table);
+}
+
+/^>/ {
+	++s;
+	otu[s] = $1;
+	sub(">", "", otu[s]);
+	sequence[s] = "";
+}
+{
+	if (substr($1, 1, 1) != ">")
+		sequence[s] = sequence[s] $1;
+}
+END {
+	for (i = 0; i <= s; ++i) {
+		printf("INSERT INTO %s (otu, sequence) VALUES (\"%s\", \"%s\");\n", table, otu[i], sequence[i]);
+	}
+}


Script for sampling N number of random reads from FASTQ files.

error: pathspec 'sampleReads.awk' did not match any file(s) known to git

--- sampleReads.awk
+++ sampleReads.awk
@@ -0,0 +1,29 @@
+#!/usr/bin/awk -f
+BEGIN{RS="@";
+    ORS="";
+    FS="\n"
+    if(ARGC< 3){
+	n=0;
+	count=-1;}
+    else{
+	n=ARGV[2];
+	count=0;}
+    delete ARGV[2];
+    srand();
+
+    print "Usage:\n\tsampleReads.awk <INFILE.fastq> <NUMBER OF READS TO BE SAMPLED>\n\nIf no number is provided reads will be sampled randomly till the end of the inpuit file.\n\n";
+
+}
+{
+    OUTF="subsam_" FILENAME;
+    OUTF2="unsam_" FILENAME;
+    if (rand() >= 0.5 && count < n  && NF > 1){
+	print "@" $0 >> OUTF;
+	if(n != 0)
+	    count=count+1;
+    }
+    else if (NF > 1)
+	print "@" $0 >> OUTF2;
+
+}
+


tools: introduce log analyzer

tools: introduce log analyzer

The included AWK script can analyze logs from BeeeOn Server in the current
configuration. It also handles two date-time formats used:

* testing: hh:mm:ss.iii
* production: YY-MM-DD hh:mm:ss.iii

The script tries to determine timing of certain operations (if the logs
contain enough information), counts unique clients, client requests, etc.

Signed-off-by: Jan Viktorin <3eab6ac54c005c4408f608556a6663b7f2abede7@fit.vutbr.cz>

error: pathspec 'tools/log-analyze.awk' did not match any file(s) known to git

--- tools/log-analyze.awk
+++ tools/log-analyze.awk
@@ -0,0 +1,423 @@
+#! /usr/bin/awk -f
+
+function log_trim_left(line)
+{
+	sub(/^.+\[(Trace|Debug|Information|Notice|Warning|Error|Critical|Fatal)\] /, "", line)
+	return line
+}
+
+function log_trim_right(line)
+{
+	sub(/\([^)]*:[0-9]*\)$/, "", line)
+	return line
+}
+
+function log_extract_pid_tid(line)
+{
+	sub(/:\{/, "-", line)
+	sub(/,.+$/, "", line)
+
+	return line
+}
+
+function extract_message(line)
+{
+	line = log_trim_left(line)
+	return log_trim_right(line)
+}
+
+function time2ms(time, part, result)
+{
+	split(time, part, "[:.]")
+
+	result = part[1] * 60 * 60 * 1000
+	result += part[2] * 60 * 1000
+	result += part[3] * 1000
+	result += part[4]
+
+	return result
+}
+
+function time_stat(start, end)
+{
+	if (start == 0)
+		return "??:??:??.???.." end " ?ms"
+
+	return start ".." end " " (time2ms(end) - time2ms(start)) "ms"
+}
+
+function report_counts(title, counts)
+{
+	if (counts[0] > 0) {
+		print title ":", counts[0]
+
+		for (key in counts) {
+			if (key == 0)
+				continue
+
+			print "*", key ":", counts[key]
+		}
+	}
+}
+
+function clear_array(array, first_zero) {
+	for (key in array)
+		delete array[key]
+
+	if (first_zero)
+		array[0] = 0
+}
+
+function count_array(array, key, count) {
+	count = 0
+	for (key in array)
+		count += 1
+
+	return count
+}
+
+function report_server_stats()
+{
+	report_counts("Criticals", criticals)
+	report_counts("Fatals", fatals)
+
+	report_counts("XML-UI clients", xmlui_clients)
+
+	if (xmlui_requests[0] > 0) {
+		print "Requests"
+
+		for (key in xmlui_requests) {
+			if (key == 0)
+				continue
+
+			split(key, multikey, SUBSEP)
+			if (multikey[2] != "ip")
+				continue
+
+			ip = xmlui_requests[multikey[1], "ip"]
+			start = xmlui_requests[multikey[1], "start"]
+			end = xmlui_requests[multikey[1], "end"]
+			info = xmlui_requests[multikey[1], "info"]
+
+			print "*", ip ":", time_stat(start, end), info
+		}
+	}
+
+	report_counts("REST-UI clients", restui_clients)
+
+	if (count_array(restui_requests_total) > 0) {
+		print "REST-UI Requests"
+		for (key in restui_requests_total) {
+			print "*", key ":", restui_requests_total[key]
+		}
+	}
+
+	if (count_array(restui_requests_uri) > 0) {
+		print "REST-UI URIs"
+		for (key in restui_requests_uri) {
+			print "*", key ":", restui_requests_uri[key]
+		}
+	}
+
+	report_counts("GWS clients", gws_clients)
+
+	if (transactions[0] > 0) {
+		print "Transactions"
+
+		for (key in transactions) {
+			if (key == 0)
+				continue
+
+			split(key, multikey, SUBSEP)
+			if (multikey[2] != "id")
+				continue
+
+			id = transactions[multikey[1], "id"]
+			type = transactions[multikey[1], "type"]
+			start = transactions[multikey[1], "start"]
+			end = transactions[multikey[1], "end"]
+
+			print "*", id ":", time_stat(start, end), type
+		}
+	}
+}
+
+function clear_stats()
+{
+	clear_array(fatals, 1)
+	clear_array(criticals, 1)
+	clear_array(xmlui_clients, 1)
+	clear_array(xmlui_requests, 1)
+	clear_array(restui_clients, 1)
+	clear_array(restui_requests_total, 0)
+	clear_array(restui_requests_uri, 0)
+	clear_array(gws_clients, 1)
+	clear_array(transactions, 1)
+	clear_array(thread_pools, 1)
+
+	types_count = 0
+	enums_count = 0
+	devs_count = 0
+	queries_count = 0
+	instances_count = 0
+	rest_mappings = 0
+}
+
+BEGIN {
+	clear_stats()
+	HAS_DATE = 0
+}
+
+/ (19[0-9]{2}|20[0-9]{2})-[012][0-9]-[0-3][0-9] / {
+	HAS_DATE = 1
+}
+
+!/ (19[0-9]{2}|20[0-9]{2})-[012][0-9]-[0-3][0-9] / {
+	HAS_DATE = 0
+}
+
+/PermitAuthProvider/ && /SOME AUTHS/ {
+	print
+}
+
+/PermitAuthProvider/ {
+	next
+}
+
+/\[Fatal\]/ {
+	_line = $0
+	_msg = extract_message($0)
+
+	if (fatals[_msg] == 0)
+		fatals[0] += 1
+
+	fatals[_msg] += 1
+	if (fatals[_msg] == 1)
+		print line
+}
+
+/\[Critical\]/ {
+	_line = $0
+	_msg = extract_message($0)
+
+	if (criticals[_msg] == 0)
+		criticals[0] += 1
+
+	criticals[_msg] += 1
+	if (criticals[_msg] == 1)
+		print line
+}
+
+/^Application / && / version / {
+	report_server_stats()
+	clear_stats()
+
+	if (HAS_DATE)
+		_time = $2 " " $3
+	else
+		_time = $2
+
+	print "# Server run report " _time
+	print extract_message($0)
+}
+/^Application / && / Poco library / {
+	print extract_message($0)
+}
+
+/IcuLocaleManager/ && /using ICU / {
+	print extract_message($0)
+}
+
+/IcuLocaleManager/ && /resource dir: / {
+	print extract_message($0)
+}
+
+/IcuLocaleManager/ && /detected locale: / {
+	$0 = log_trim_left($0)
+	print "locale: ", $3
+}
+
+/PocoDaoManager/ && /initialize database/ {
+	print extract_message($0)
+}
+
+/PocoDaoManager/ && /Session / && /transact/ {
+	print extract_message($0)
+}
+
+/PocoSqitchInitializer/ && /unsafe deploy / {
+	print extract_message($0)
+}
+
+/PocoSimpleDBInitializer/ && /executed script / {
+	print extract_message($0)
+}
+
+/TypeInfoProvider/ && /register type / {
+	types_count += 1
+}
+
+/EnumInfoProvider/ && /register enum / {
+	enums_count += 1
+}
+
+/DevicesSAXHandler/ && /Warning/ {
+	print extract_message($0)
+}
+
+/DeviceInfoProvider/ && /register device / {
+	devs_count += 1
+}
+
+/ loading query / {
+	queries_count += 1
+}
+
+/DependencyInjector/ && /successfully created / {
+	instances_count += 1
+}
+
+/RestRouter/ && /mapping / {
+	rest_mappings += 1
+}
+
+/^Application/ && /starting runner/ {
+	print extract_message($0)
+}
+
+/ creating thread pool / {
+	$0 = log_trim_left($0)
+	_curr = thread_pools[0] + 1
+	thread_pools[0] = _curr
+	thread_pools[_curr, "min"] += $5
+	thread_pools[_curr, "max"] += $7
+}
+
+/LoopRunner/ && / started / && / loops / {
+	print "Value types:   ", types_count
+	print "Enum subtypes: ", enums_count
+	print "Device types:  ", devs_count
+	print "DB queries:    ", queries_count
+	print "DI instances:  ", instances_count
+	print "REST mappings: ", rest_mappings
+
+	$0 = log_trim_left($0)
+	print "Loops:         ", $2
+
+	threads_min = 0
+	threads_max = 0
+
+	for (i = 0; i < thread_pools[0]; ++i) {
+		threads_min += thread_pools[i + 1, "min"]
+		threads_max += thread_pools[i + 1, "max"]
+	}
+
+	print "Thread pools:  ", thread_pools[0]
+	print "Threads:       ", threads_min ".." threads_max
+}
+
+/XmlRequestHandlerFactory/ && / accepting client / {
+	_id = log_extract_pid_tid($(3 + HAS_DATE))
+	$0 = log_trim_left($0)
+
+	split($3, _addr, ":")
+	_ip = _addr[1]
+
+	if (xmlui_clients[_ip] == 0)
+		xmlui_clients[0] += 1
+
+	xmlui_clients[_ip] += 1
+	xmlui_requests_tmp[_id, "ip"] = _ip
+}
+
+/XmlRequestHandlerFactory/ && /document: <request/ {
+	_id = log_extract_pid_tid($(3 + HAS_DATE))
+	xmlui_requests_tmp[_id, "start"] = $(2 + HAS_DATE)
+
+	_msg = extract_message($0)
+
+	if (match(_msg, / ns="[^"]+" /) > 0) {
+		_ns = substr(_msg, RSTART, RLENGTH)
+		sub(/^.*="/, "", _ns)
+		sub(/".*$/, "", _ns)
+	}
+	if (match(_msg, / type="[^"]+" /) > 0) {
+		_type = substr(_msg, RSTART, RLENGTH)
+		sub(/^.*="/, "", _type)
+		sub(/".*$/, "", _type)
+	}
+
+	xmlui_requests_tmp[_id, "info"] = _ns ":" _type
+}
+
+/XmlRequestHandler/ && /<response/ {
+	_id = log_extract_pid_tid($(3 + HAS_DATE))
+	_curr = xmlui_requests[0] + 1
+	xmlui_requests[0] = _curr
+
+	xmlui_requests[_curr, "ip"] = xmlui_requests_tmp[_id, "ip"]
+	delete xmlui_requests_tmp[_id, "ip"]
+	xmlui_requests[_curr, "start"] = xmlui_requests_tmp[_id, "start"]
+	delete xmlui_requests_tmp[_id, "start"]
+	xmlui_requests[_curr, "info"] = xmlui_requests_tmp[_id, "info"]
+	delete xmlui_requests_tmp[_id, "info"]
+
+	xmlui_requests[_curr, "end"] = $(2 + HAS_DATE)
+}
+
+/PocoRestRequestFactory/ && /handling request/ {
+	$0 = extract_message($0)
+	restui_requests_total[$3] += 1
+	restui_requests_uri[$4] += 1
+
+	split($6, _addr, ":")
+	_ip = _addr[1]
+
+	if (restui_clients[_ip] == 0)
+		restui_clients[0] += 1
+
+	restui_clients[_ip] += 1
+}
+
+/WebSocketRequestHandler/ && /connection from / {
+	$0 = log_trim_left($0)
+
+	split($3, _addr, ":")
+	_ip = _addr[1]
+
+	if (gws_clients[_ip] == 0)
+		gws_clients[0] += 1
+
+	gws_clients[_ip] += 1
+}
+
+/ transaction / && / started / {
+	_time = $(2 + HAS_DATE)
+	_thread = log_extract_pid_tid($(3 + HAS_DATE))
+	$0 = extract_message($0)
+	_id = $2 "-" _thread
+	transactions_tmp[_id, "start"] = _time
+}
+
+/ transaction / && (/ commit / || / rollback /) {
+	_time = $(2 + HAS_DATE)
+	_thread = log_extract_pid_tid($(3 + HAS_DATE))
+	$0 = extract_message($0)
+	_id = $2 "-" _thread
+	_type = $3
+
+	_curr = transactions[0] + 1
+	transactions[0] = _curr
+
+	transactions[_curr, "start"] = transactions_tmp[_id, "start"]
+	delete transactions_tmp[_id, "start"]
+
+	transactions[_curr, "end"] = _time
+	transactions[_curr, "type"] = _type
+	transactions[_curr, "id"] = _id
+}
+
+END {
+	report_server_stats()
+	clear_stats()
+}


port of csvquote to awk. no command line options support yet. it's slow

error: pathspec 'csvquote.awk' did not match any file(s) known to git

--- csvquote.awk
+++ csvquote.awk
@@ -0,0 +1,99 @@
+#!/usr/bin/awk -f
+# csvquote in awk
+# TODO assign the special characters using command line flags
+# TODO add header mode
+
+BEGIN {
+    # read one line at a time
+    FS="";
+    OFS=FS;
+    delimiter=",";
+    recordsep="\n";
+    quotechar="\"";
+    delimiter_code="\035";
+    recordsep_code="\034";
+    replace_mode = 1; # true. if restore mode then 0
+    # existing_state is a global variable
+    existing_state[1] = 0; # false
+    existing_state[2] = 0; # false
+    existing_state[3] = ""; # empty buffer
+}
+
+function replace_special_chars(c) {
+    # existing_state is a global variable. it could be passed in as an array
+    # (pass-by-ref) but we still need to persist its state from one input
+    # line to the next and it needs to be altered by this function, so
+    # can't be simple variables
+    quote_in_effect = existing_state[1];
+    maybe_escaped_quote_char = existing_state[2];
+    writebuf = existing_state[3];
+
+    if (maybe_escaped_quote_char) {
+        if (c != quotechar) {
+            # this is the end of a quoted field
+            quote_in_effect = 0; # false
+        }
+        writebuf = writebuf c; # concat
+        maybe_escaped_quote_char = 0; # false
+    } else if (quote_in_effect) {
+        if (c == quotechar) {
+            # this is either an escaped quote char or the end of a quoted
+            # field. need to read one more character to decide which
+            writebuf = writebuf c; # concat
+            maybe_escaped_quote_char = 1; # true
+        } else if (c == delimiter) {
+            writebuf = writebuf delimiter_code; # concat
+        } else if (c == recordsep) {
+            writebuf = writebuf recordsep_code; # concat
+        } else {
+            writebuf = writebuf c; # concat
+        }
+    } else {
+        # quote not in effect
+        writebuf = writebuf c; # concat
+        if (c == quotechar) {
+            quote_in_effect = 1; # true
+        }
+    }
+
+    existing_state[1] = quote_in_effect;
+    existing_state[2] = maybe_escaped_quote_char;
+    existing_state[3] = writebuf;
+}
+
+function restore_special_chars(c) {
+    writebuf = existing_state[3];
+    if (c == delimiter_code) {
+        writebuf = writebuf delimiter; # concat
+    } else if (c == recordsep_code) {
+        writebuf = writebuf recordsep; # concat
+    } else {
+        writebuf = writebuf c; # concat
+    }
+    existing_state[3] = writebuf;
+}
+
+(replace_mode) {
+    # do this for every input line
+    for (i=1;i<=NF;i++) {
+        replace_special_chars($i);
+    }
+    printf("%s", existing_state[3]);
+    existing_state[3] = "";
+    replace_special_chars(RS);
+}
+
+(!replace_mode) {
+    # restore the original special characters
+    # do this for every input line
+    for (i=1;i<=NF;i++) {
+        restore_special_chars($i);
+    }
+    printf("%s", existing_state[3]);
+    existing_state[3] = "";
+    restore_special_chars(RS);
+}
+
+END {
+    printf("%s", existing_state[3]); #flush
+}


Add a simple stats tool

Add a simple stats tool

error: pathspec 'trunk/JLanguageTool/src/dev/tools/stats.awk' did not match any file(s) known to git

--- trunk/JLanguageTool/src/dev/tools/stats.awk
+++ trunk/JLanguageTool/src/dev/tools/stats.awk
@@ -0,0 +1,44 @@
+#Script to sort rule matches from LanguageTool
+#Usage: gawk -f stats.awk <file_created_by_LanguageTool>
+#(c) 2008, Marcin Mikowski
+#Licensed on the terms of LGPL 3.0
+
+/[0-9]+\.\)/ {
+gsub(/^.*ID: /,"")
+rule_cnt[$0]++
+current_rule=$0
+rulematch=1
+}
+/^$/ {current_rule=""}
+/^(Message: |Suggestion: |\.\.\.)/ {
+comments[current_rule]= comments[current_rule] "\n" $0
+}
+/^ / && / \^/ {
+comments[current_rule]= comments[current_rule] "\n" $0 "\n"
+}
+END {
+if (rulematch==1) {
+print "LanguageTool rule matches in descending order"
+print "============================================="
+print ""
+}
+z = asorti(rule_cnt, rule_names)
+#for (i = 1; i <= z; i++)
+ #   print i " " rule_names[i]
+n = asort(rule_cnt, rules)
+
+for (i = z; i >= 1; i--) {
+
+	for (j = 1; j <= z; j++) {
+#		print j " " rule_names[j] " => " rule_cnt[rule_names[j]]
+		if (rule_cnt[rule_names[j]]==rules[i] \
+			&& printed[rule_names[j]]!="done") {
+				printed[rule_names[j]]="done"
+				rule=rule_names[j]
+	print "Rule ID: " rule ", matches: " rule_cnt[rule]
+	print comments[rule]
+	print "============="
+		}
+	}
+}
+}


Hello world in AWK language

Hello world in AWK language

error: pathspec 'Hello' did not match any file(s) known to git
error: pathspec 'AWK/Sudhanshu36.awk' did not match any file(s) known to git


Find largest ordered word

Find largest ordered word

error: pathspec 'praxis/ordered-words.awk' did not match any file(s) known to git

--- praxis/ordered-words.awk
+++ praxis/ordered-words.awk
@@ -0,0 +1,18 @@
+# Largest ordered word
+# Copyright 2015 Dennis Decker Jensen
+# Tectonics: awk -f ordered-words.awk < /usr/share/dict/words
+
+BEGIN {
+        maxlen = length(max = "")
+}
+{
+        word = $0
+        len = length(word)
+        if (len < maxlen) next
+        for (i = 1; i <= len - 1; ++i)
+                if (substr(word, i, 1) < substr(word, i + 1, 1))
+                        maxlen = length(max = word)
+}
+END {
+        printf("Largest word '%s' is %d characters long\n", max, maxlen)
+}


checkpoint

checkpoint

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/stuartyeates/rsnz-fellows.git/'


first

first

error: pathspec 'trunk/languagetool/dict-de/awk/checkaffix.awk' did not match any file(s) known to git

--- trunk/languagetool/dict-de/awk/checkaffix.awk
+++ trunk/languagetool/dict-de/awk/checkaffix.awk
@@ -0,0 +1,45 @@
+#
+# check_affix.awk
+#  check affix file for Oo myspell
+#
+function is_fx(s)
+{
+   if(s == "PFX")
+	  return 1;
+   if(s == "SFX")
+	  return 2;
+	 if(s == "REP")
+	  return 3;
+   return 0;
+}
+BEGIN {linenr = 0; nr = 0;}
+
+    { ++linenr;
+	   if(nr){
+		  if(sorszam++ == nr){
+		     sorszam = 0;
+			  nr = 0;
+
+			  if(NF > 1 && substr($0,1,1) != "#" && ((is_fx($1) < 3) && (is_fx($1) > 0)  && ($4 + 0) == 0)){
+		        print "2. error in line " linenr " line:" $0;
+#			  next;
+           }
+		  }
+		  else if($1 != veg || ((fxtyp < 3) && (($2 != typ) || (NF < 5)) )){
+		    print "1. error in line " linenr" line:" $0;
+		     sorszam = 0;
+			  nr = 0;
+			  next;
+		 }
+		  else
+		    next;
+		 }
+	   while(!(ret = is_fx($1)))next;
+		 veg = $1;
+		 typ = $2;
+		 fxtyp = ret;
+		 if(ret < 3) nr = $4 + 0;
+		    else nr = $2 + 0;
+       sorszam = 0;
+#		 print "---1 " $0" nr:"nr;
+		}


Add a script to parse acpi_quirks into a header file that we can compile
into ACPI.  Script written by Mark Santcroos with some edits from myself.

Submitted by:	marks

error: pathspec 'sys/tools/acpi_quirks2h.awk' did not match any file(s) known to git

--- sys/tools/acpi_quirks2h.awk
+++ sys/tools/acpi_quirks2h.awk
@@ -0,0 +1,191 @@
+#!/usr/bin/awk -f
+#
+# $FreeBSD$
+#
+# Copyright (c) 2004 Mark Santcroos <marks@ripe.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+BEGIN {
+	OUTPUT="acpi_quirks.h"
+}
+
+# Print header and id
+NR == 1 {
+	VERSION = $0;
+	gsub("\^# ", "", VERSION)
+	gsub("\\$", "", VERSION)
+
+	printf("/*\n") > OUTPUT;
+	printf(" * THIS FILE IS AUTOMAGICALLY GENERATED.  DO NOT EDIT.\n") \
+	    > OUTPUT;
+	printf(" *\n") > OUTPUT;
+	printf(" * Generated from:\n") > OUTPUT;
+	printf(" * %s\n", VERSION) > OUTPUT;
+	printf(" */\n\n") > OUTPUT;
+}
+
+# Ignore comments and empty lines
+/^#/, NF == 0 {
+}
+
+#
+# NAME field: this is the first line of every entry
+#
+$1 == "name:" {
+	ENTRY_NAME = $2;
+	printf("const struct acpi_table %s[] = {\n", ENTRY_NAME) > OUTPUT;
+}
+
+#
+# OEM field
+#
+$1 == "oem:" {
+	LENGTH = length();
+
+	# Parse table type to match
+	TABLE = $2;
+
+	# Parse OEM ID
+	M = match ($0, /\"[^\"]*\"/);
+	OEM_ID = substr($0, M, RLENGTH);
+
+	# Parse OEM Table ID
+	ANCHOR = LENGTH - (M + RLENGTH - 1);
+	REMAINDER = substr($0, M + RLENGTH, ANCHOR);
+	M = match (REMAINDER, /\"[^\"]*\"/);
+	OEM_TABLE_ID = substr(REMAINDER, M, RLENGTH);
+
+	printf("\t{ ACPI_TABLE_%s, OEM, %s, %s },\n",
+	    TABLE, OEM_ID, OEM_TABLE_ID) > OUTPUT;
+}
+
+#
+# CREATOR field
+#
+$1 == "creator:" {
+	# Parse table type to match
+	TABLE = $2;
+
+	M = match ($0, /\"[^\"]*\"/);
+	CREATOR = substr($0, M, RLENGTH);
+
+	printf("\t{ ACPI_TABLE_%s, CREATOR, %s },\n", TABLE, CREATOR) > OUTPUT;
+}
+
+#
+# OEM REVISION field
+#
+$1 == "oem_rev:" {
+	TYPE = $2;
+	SIGN = $3;
+	VALUE = $4;
+
+	# Parse operand
+	OPERAND = trans_sign(SIGN);
+
+	# Parse OEM revision ID
+	REV = "OEM_REV";
+
+	printf("\t{ ACPI_TABLE_%s, %s, %s, %s },\n",
+	    TYPE, REV, OPERAND, VALUE) > OUTPUT;
+}
+
+#
+# CREATOR REVISION field
+#
+$1 == "creator_rev:" {
+	TYPE = $2;
+	SIGN = $3;
+	VALUE = $4;
+
+	# Parse operand
+	OPERAND = trans_sign(SIGN);
+
+	# Parse creator revision ID
+	REV = "CREATOR_REV";
+
+	printf("\t{ ACPI_TABLE_%s, %s, %s, %s },\n",
+	    TYPE, REV, OPERAND, VALUE) > OUTPUT;
+}
+
+#
+# QUIRKS field: This is the last line of every entry
+#
+$1 == "quirks:" {
+	printf("\t{ ACPI_TABLE_END }\n};\n\n") > OUTPUT;
+
+	QUIRKS = $0;
+	sub(/^quirks:[ ]*/ , "", QUIRKS);
+
+	QUIRK_COUNT++;
+	QUIRK_LIST[QUIRK_COUNT] = QUIRKS;
+	QUIRK_NAME[QUIRK_COUNT] = ENTRY_NAME;
+}
+
+#
+# All information is gathered, now create acpi_quirks_table
+#
+END {
+	# Header
+	printf("const struct acpi_blacklist acpi_quirks_table[] = {\n") \
+	    > OUTPUT;
+
+	# Array of all quirks
+	for (i = 1; i <= QUIRK_COUNT; i++) {
+		printf("\t{ %s, %s },\n", QUIRK_NAME[i], QUIRK_LIST[i]) \
+		    > OUTPUT;
+	}
+
+	# Footer
+	printf("\t{ NULL, 0 }\n") > OUTPUT;
+	printf("};\n") > OUTPUT;
+
+	exit(0);
+}
+
+#
+# Translate math SIGN into verbal OPERAND
+#
+function trans_sign(TMP_SIGN)
+{
+	if (TMP_SIGN == "=")
+		TMP_OPERAND = "OP_EQL";
+	else if (TMP_SIGN == "!=")
+		TMP_OPERAND = "OP_NEQ";
+	else if (TMP_SIGN == "<=")
+		TMP_OPERAND = "OP_LEQ";
+	else if (TMP_SIGN == ">=")
+		TMP_OPERAND = "OP_GEQ";
+	else if (TMP_SIGN == ">")
+		TMP_OPERAND = "OP_GTR";
+	else if (TMP_SIGN == "<")
+		TMP_OPERAND = "OP_LES";
+	else {
+		printf("error: unknown sign: " TMP_SIGN "\n");
+		exit(1);
+	}
+
+	return (TMP_OPERAND);
+}


print ac_join(sb, RS)

print ac_join(sb, RS)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/svnpenn/sage.git/'


Added an awk script to analyze app fractions.

error: pathspec 'energy-data-processing/analyze-apps-fractions.awk' did not match any file(s) known to git

--- energy-data-processing/analyze-apps-fractions.awk
+++ energy-data-processing/analyze-apps-fractions.awk
@@ -0,0 +1,19 @@
+#!/usr/bin/awk -f
+
+$0 ~ "app fractions:" {
+  print $0
+  c=1
+}
+
+c == 1 {
+  w=$(NF-1)
+  if (w+0 != w)
+    next
+  v=$(NF)
+  if (v+0 != v)
+    next
+  if (w == 0 && v == 0)
+    next
+  print $0
+}
+


Add uniqueLines.awk

Add uniqueLines.awk

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/SergKolo/sh.git/'


Added an awk script for examining complete journal logs in one place.

error: pathspec 'fulllog.awk' did not match any file(s) known to git

--- fulllog.awk
+++ fulllog.awk
@@ -0,0 +1,14 @@
+# 2 january 2015
+# usage: ./e4jexamine summary file | awk -f fulllog.awk file
+# TODO pass options to e4jexamine
+BEGIN {
+	file = ARGV[1]
+	ARGC = 1
+}
+{ print }
+/descriptor/ {
+	cmd = sprintf("./e4jexamine descdump.%s %s", $1, file)
+	while (cmd | getline)
+		printf "\t%s\n", $0
+	close(cmd)
+}


imprement md parser

imprement md parser

error: pathspec 'md2slide.awk' did not match any file(s) known to git


Added Harshad Number in AWK

Added Harshad Number in AWK

error: pathspec '10_Harshad_Number/AWK/wasi0013/HarshadNumber.awk' did not match any file(s) known to git

--- 10_Harshad_Number/AWK/wasi0013/HarshadNumber.awk
+++ 10_Harshad_Number/AWK/wasi0013/HarshadNumber.awk
@@ -0,0 +1,41 @@
+# Harshad Number implementation
+# See: http://en.wikipedia.org/wiki/Harshad_number
+
+func sumdigits(n){
+    result=0;
+
+    while(n){
+
+        result+=(n%10);
+        n=int(n/10);
+
+    }
+
+    return result;
+}
+
+#Test wheather a number is harshad number or not
+func isharshad(n){
+    return n%sumdigits(n)==0;
+}
+
+
+BEGIN {
+
+  print("Testing for Harshad Numbers");
+  count=0;
+
+  #There are 33 harshad numbers in the range 1-100
+  for(i=1;i<101;i++){
+      #count = count + 1 if harshad number else count + 0
+      count+= isharshad(i) ? 1 : 0 ;
+  }
+
+}
+END {
+
+ print("The test was ",count==33?"Successful":"Unsuccessful");
+
+
+
+}


Add an awk script to list all targets returned by xcodebuild -list

error: pathspec 'targets.awk' did not match any file(s) known to git


add awk script to read out variable information from ncdump -h to utils

error: pathspec 'util/variable_information.awk' did not match any file(s) known to git

--- util/variable_information.awk
+++ util/variable_information.awk
@@ -0,0 +1,42 @@
+#!/bin/awk -f
+
+# This awk script parses the output of ncdump -h to read information about
+# the variables.
+# The current version reads 2D and 3D variables from a CESM file.
+#
+# run with: ncdump -h FILE.nc4 | ./variable_information.awk > out.txt
+
+BEGIN {
+    OFS = "\t";
+    print "VARIABLE", "INFO", "VALUE";
+}
+
+/float .*(time, lev, ncol)/ {
+    variable = $2;
+    sub(/\(.*/,"",variable); # remove dimension information
+    print variable, "levels", 30;
+}
+
+/float .*(time, ilev, ncol)/ {
+    variable = $2;
+    sub(/\(.*/,"",variable); # remove dimension information
+    print variable, "levels", 31;
+}
+
+/float .*(time, ncol)/ {
+    variable = $2;
+    sub(/\(.*/,"",variable); # remove dimension information
+    print variable, "levels", 1;
+}
+
+/.*:long_name = / {
+    var = $1;
+    sub(/:long_name/,"",var); # remove ":long_name"
+    if (var == variable) { # only print names when levels have been printed just before
+        name = $3;
+        for (i=4; i<=NF; i++) name = name " " $i;
+        gsub(/"/,"",name); # remove quotes from variable name
+        sub(/ ;/,"",name); # remove trailing ";" from variable name
+        print variable, "name", name;
+    }
+}


2008-04-15  Martin Sebor  <sebor@roguewave.com>

	* bin/xcomp.awk: Enclosed runtime warnings in parentheses
	as documented in the legend at the bottom of the generated
	page.

git-svn-id: 8ce9432b95a2a271c6c279131eb1bb968a8ee7fb@648319 13f79535-47bb-0310-9956-ffa450edef68

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pathscale/stdcxx.git/'


add tool.nswd/calc_surfacedensity.awk

add tool.nswd/calc_surfacedensity.awk

error: pathspec 'tool.nswd/calc_surfacedensity.awk' did not match any file(s) known to git


SCCS mkdoc.awk 10/04/29 00:19:44: date and time created 10/04/29 00:19:44 by neo

error: pathspec 'run/mkdoc.awk' did not match any file(s) known to git

--- run/mkdoc.awk
+++ run/mkdoc.awk
@@ -0,0 +1,464 @@
+#-------------------------------------------------------------------------------
+# Phorward SDK - mkdoc :: Documentation Generator
+# Copyright (C) 2009, 2010 by Phorward Software Technologies, Jan Max Meyer
+# http://www.phorward-software.com ++ mail<<AT>>phorward-software<<DOT>>com
+#
+# Script:		mkdoc.awk
+# Author:		Jan Max Meyer
+#-------------------------------------------------------------------------------
+
+BEGIN	{
+			SUBSEP = "#"
+
+			print_sections = 1
+			full_index = 0
+			tpldir = getenv( "PHOME" ) "/tpl"
+			manual = ""
+
+			t = 1
+
+			# Begin of program
+			for( i = 1; i < ARGC; i++ )
+			{
+				if( ARGV[i] == "-o" )
+					output = ARGV[++i]
+				else if( ARGV[i] == "-i" )
+					full_index = 1
+				else if( ARGV[i] == "-ns" )
+					print_sections = 0
+				else if( ARGV[i] == "-tpl" && i+1 < ARGC )
+					tpldir = ARGV[++i]
+				else if( ARGV[i] == "-m" && i+1 < ARGC )
+					manual = readfile( ARGV[++i] )
+				else if( ARGV[i] == "-c" && i+1 < ARGC )
+					allcopyright = ARGV[++i]
+				else if( ARGV[i] == "-t" && i+1 < ARGC )
+					alltitle = ARGV[++i]
+				else if( ARGV[i] == "-u" && i+1 < ARGC )
+					allusage = ARGV[++i]
+				else
+					files[ j++ ] = ARGV[i]
+			}
+
+			if( substr( tpldir, length( tpldir ) - 1, 1 ) != "/" )
+				tpldir = tpldir "/"
+
+			# Read all templates
+			tpl[ "DOCUMENT" ] = readfile( tpldir "document.tpl" )
+			tpl[ "MODULE" ] = readfile( tpldir "module.tpl" )
+			tpl[ "FUNCTION" ] = readfile( tpldir "function.tpl" )
+			tpl[ "parameters" ] = readfile( tpldir "parameter.tpl" )
+			tpl[ "returns" ] = readfile( tpldir "returns.tpl" )
+			tpl[ "refentry" ] = readfile( tpldir "refentry.tpl" )
+
+			document = tpl[ "DOCUMENT" ]
+
+			# Process the files
+			for( i in files )
+			{
+				process( files[i] )
+
+				if( print_sections )
+				{
+					#Output the header and index of contents
+					gsub( "!!" "index", print_idx(), head_text )
+					gsub( "!!" "contents", print_ref(), head_text )
+
+					#all_text = all_text head_text
+					#all_text = all_text print_ref()
+
+					all_text = all_text head_text
+
+					head_text = ""
+				}
+
+				if( full_index )
+				{
+					for( s in functions )
+						all_functions[ s ] = functions[ s ]
+				}
+
+				for( s in functions )
+					delete functions[s]
+			}
+
+			if( full_index )
+			{
+				for( s in all_functions )
+					functions[ s ] = all_functions[ s ]
+
+				if( !print_sections )
+					all_text = print_ref()
+
+				allindex = print_idx()
+			}
+
+			if( document != "" )
+			{
+				gsub( "!!" "title", alltitle, document )
+				gsub( "!!" "usage", allusage, document )
+				gsub( "!!" "copyright", allcopyright, document )
+				gsub( "!!" "manual", manual, document )
+				gsub( "!!" "index", allindex, document )
+				gsub( "!!" "reference", all_text, document )
+			}
+			else
+				document = all_text
+
+			#Finally print all!
+			print document
+		}
+
+
+function process( file )
+{
+	section = ""
+	current_item = ""
+	old_item = ""
+	nodoc = 0
+	line = 1
+
+	while( getline line <file > 0 )
+	{
+		#this could be windoof files
+		gsub( "\r", "", line )
+		line = trim( line )
+
+		section_line++
+
+		if( line == "" )
+		{
+			if( current_item == "usage" || current_item == "copyright" )
+				items[ current_item ] = items[ current_item ] "\n"
+
+			continue
+		}
+
+		#Look for section?
+		if( section == "NODOC" && index( line, "COD_ON" ) >= 1 )
+			section = "";
+		else if( section == "" )
+		{
+			if( index( line, "/* -MODULE" ) == 1 )
+				section = "MODULE"
+			else if( index( line, "/* -FUNCTION" ) == 1 )
+				section = "FUNCTION"
+			else if( index( line, "NO_DOC" ) >= 1 )
+				section = "NODOC";
+
+			current_item = ""
+			section_line = 0
+		}
+		else if( section != "NODOC" )
+		{
+			#End of a section
+			if( index( line, "--------------------------------------------" \
+					"--------------------------------- */" ) == 1 \
+				|| index( line, "~~~ CHANGES & NOTES ~~~" ) > 0 )
+			{
+				# create a function parameter synopsis!
+				if( section == "FUNCTION" )
+				{
+					#Generate RETURNTYPE and RETURNDESC
+					if( items[ "returns" ] != "" )
+					{
+						if( index( items[ "returns" ], " " ) )
+						{
+							datatype = substr( items[ "returns" ], 1, \
+										index( items[ "returns" ], " " ) - 1 )
+							desc = 	substr( items[ "returns" ], \
+										index( items[ "returns" ], " " ) + 1 )
+						}
+						else
+						{
+							datatype = items[ "returns" ]
+							desc = "Nothing"
+						}
+
+						items[ "returntype" ] = datatype
+
+						if( desc == "" )
+							desc = "Nothing."
+
+						items[ "returndesc" ] = desc
+					}
+
+					#Generate function-name
+					gsub( /\(.*\)$/, "", items[ "function" ] )
+
+					#GENERATE SYNOPSIS
+					items[ "synopsis" ] = items[ "function" ]
+					#gsub( /\(.*\)$/, "", items[ "synopsis" ] )
+					items[ "synopsis" ] = items[ "synopsis" ] "( "
+
+					first = 1
+					for( item in items )
+					{
+						if( match( item, "parameters" SUBSEP "[0-9]+" ) )
+						{
+							datatype = substr( items[ item ], 1, \
+								index( items[ item ], " " ) - 1 )
+							desc = substr( items[ item ], \
+										index( items[ item ], " " ) + 1 )
+
+							if( datatype != "..." )
+							{
+								param = substr( desc, 1, index( desc, " " ) - 1 )
+								desc = 	substr( desc, index( desc, " " ) + 1 )
+							}
+							else
+								param = ""
+
+							if( !first )
+								items[ "synopsis" ] = items[ "synopsis" ] ", "
+							first = 0
+
+							items[ "synopsis" ] = items[ "synopsis" ] datatype
+							if( param != "" )
+								items[ "synopsis" ] = items[ "synopsis" ] \
+									" " param
+						}
+					}
+
+					if( first )
+						items[ "synopsis" ] = items[ "synopsis" ] "void )"
+					else
+						items[ "synopsis" ] = items[ "synopsis" ] " )"
+
+					items[ "synopsis" ] = items[ "returntype" ] " " \
+											items[ "synopsis" ]
+
+					#Put code in array first, for sorting
+					funcname =  items[ "function" ]
+					#gsub( /_|\(|\)/, "", funcname )
+
+					# GENERATE OUTPUT...
+					#write index of contents as a quick reference
+					if( !index( items[ "usage" ], "." ) )
+						items[ "usage" ] = trim( items[ "usage" ] ) "."
+
+					content[ funcname ] = substr( items[ "usage" ], \
+											1, index( items[ "usage" ], "." ) )
+
+					#Write output into functions array
+					functions[ funcname ] = fill_tex_tpl( section, items )
+				}
+				else if( head_text == "" )
+					head_text = fill_tex_tpl( section, items )
+
+				#for( item in items )
+					#print item " => \"" items[ item ] "\""
+
+				for( item in items )
+					delete items[ item ]
+
+				section = ""
+				current_item = ""
+				continue
+			}
+			else if( index( line, "File:" ) == 1 )
+				current_item = "file"
+			else if( index( line, "Author:" ) == 1 )
+				current_item = "author"
+			else if( index( line, "Usage:" ) == 1 )
+				current_item = "usage"
+			else if( index( line, "Function:" ) == 1 )
+				current_item = "function"
+			else if( index( line, "Parameters:" ) == 1 )
+			{
+				akt_parm = 1
+				current_item = "parameters" SUBSEP akt_parm
+			}
+			else if( index( line, "Returns:" ) == 1 )
+			{
+				current_item = "returns"
+			}
+			else if( section == "MODULE" && section_line == 1 )
+				current_item = "title"
+			else if( section == "MODULE" && section_line == 2 )
+				current_item = "copyright"
+
+			#Read in the item information
+			if( current_item != "" )
+			{
+				if( current_item != old_item && items[ current_item ] == "" )
+				{
+					if( current_item != "title" \
+						&& current_item != "copyright" )
+					{
+						line = trim( substr( line, index( line, ":" ) + 1 ) )
+					}
+
+					gsub( /[ \t]+/, " ", line )
+
+					items[ current_item ] = line
+				}
+				else
+				{
+					if( match( current_item, "parameters" SUBSEP "[0-9]+" ) )
+					{
+						if( match( line, \
+							"[A-Za-z0-9_*]+[ \t][ \t]+[A-Za-z0-9_*()]+[ \t]+|\\.\\.\\.[ \t]+" ) )
+						{
+							akt_parm++
+							current_item = "parameters" SUBSEP akt_parm
+
+							gsub( /[ \t]+/, " ", line )
+							items[ current_item ] = line
+						}
+					}
+
+					if( old_item == current_item )
+					{
+						gsub( /[ \t]+/, " ", line )
+
+						if( ( section == "MODULE" && current_item == "usage" ) \
+							|| current_item == "copyright" )
+							delim = "\n"
+						else
+							delim = " "
+
+						items[ current_item ] = items[ current_item ] delim line
+					}
+				}
+			}
+
+			old_item = current_item
+		}
+
+		line++;
+	}
+
+	close( getline line <file > 0 )
+}
+
+function fill_tex_tpl( section, items )
+{
+	final = tpl[ section ]
+	parameters = ""
+
+	for( item in items )
+	{
+		#print "!!" item " " items[ item ]
+
+		#for LaTeX
+		#gsub( "_", "\\_", items[ item ] )
+
+		if( match( item, "parameters" SUBSEP "[0-9]+" ) )
+		{
+			datatype = substr( items[ item ], 1, \
+						index( items[ item ], " " ) - 1 )
+			desc = 	substr( items[ item ], index( items[ item ], " " ) + 1 )
+
+			if( datatype != "..." )
+			{
+				param = substr( desc, 1, index( desc, " " ) - 1 )
+				desc = 	substr( desc, index( desc, " " ) + 1 )
+			}
+			else
+				param = ""
+
+			subfinal = tpl[ "parameters" ]
+			gsub( "!!" "datatype", datatype, subfinal )
+			gsub( "!!" "param", param, subfinal )
+			gsub( "!!" "desc", desc, subfinal )
+
+			parameters = parameters subfinal
+		}
+		else if( item == "returns" )
+		{
+			subfinal = tpl[ "returns" ]
+			gsub( "!!" "datatype", items[ "returntype" ], subfinal )
+			gsub( "!!" "desc", items[ "returndesc" ], subfinal )
+
+			gsub( "!!" item, subfinal, final )
+		}
+		else
+		{
+			gsub( "!!" item, items[ item ], final )
+		}
+	}
+
+	if( section == "FUNCTION" )
+		gsub( "!!parameters", parameters, final )
+
+	return final
+}
+
+function print_idx()
+{
+	t = 1
+	for( s in functions )
+		sort[t++] = s
+
+	n = asort( sort )
+
+	refindex = ""
+	for( s = 1; s <= n; s++ )
+	{
+		refentry = tpl[ "refentry" ]
+
+		gsub( "!!" "function", sort[s], refentry )
+		gsub( "!!" "usage", content[ sort[s] ], refentry )
+		refindex = refindex refentry
+	}
+
+	for( s in sort )
+		delete sort[s]
+
+	return refindex
+}
+
+function print_ref()
+{
+	t = 1
+	for( s in functions )
+		sort[t++] = s
+
+	n = asort( sort )
+
+	text = ""
+	for( s = 1; s <= n; s++ )
+		text = text functions[sort[s]]
+
+	for( s in sort )
+		delete sort[s]
+
+	return text
+}
+
+#--- Utility functions go here ---
+
+function ltrim( s )
+{
+	sub( /^[ \t\n]+/, "", s )
+	return s
+}
+
+function rtrim( s )
+{
+	sub( /[ \t\n]+$/, "", s )
+	return s
+}
+
+function trim( s )
+{
+	return rtrim( ltrim( s ) )
+}
+
+function readfile( s )
+{
+	f = ""
+
+	while( ( getline l < s ) > 0 )
+		f = f l "\n"
+
+	close( s )
+	return f
+}
+
+function getenv( s )
+{
+	"echo $" s | getline v
+	return v
+}


added prettyplz.awk

added prettyplz.awk

error: pathspec 'prettyplz.awk' did not match any file(s) known to git

--- prettyplz.awk
+++ prettyplz.awk
@@ -0,0 +1,37 @@
+#!/usr/bin/awk -f
+# Prettifies a Haskell list
+
+func print_indent(ind,    i) {
+	for (i = 0; i < ind; ++i)
+		printf "\t"
+}
+
+{
+	for (c = 1; c <= length($0); ++c) {
+		ch = substr($0, c, 1)
+		if (ch == "[") {
+			printf "[\n"
+			print_indent(++indent)
+		} else if (ch == "(") {
+			in_args = 1
+			printf "("
+		} else if (ch == ")") {
+			in_args = 0
+			printf ")"
+		} else if (ch == ",") {
+			if (in_args)
+				printf ", "
+			else {
+				printf ",\n"
+				print_indent(indent)
+			}
+		} else if (ch == "]") {
+			printf "\n"
+			print_indent(--indent)
+			printf "]"
+		} else {
+			printf ch
+		}
+	}
+	print ""
+}