# sh this script to unbundle awk examples echo awk.double cat >awk.double <<'END of awk.double' NF > 0 { if ($1 == lastword) print "double: ", $1, " Line: ", NR for (i=2; i <= NF; i++) { if ($i == $(i-1)) {print "Double: ", $i, "Line: ", NR} } lastword = $NF } END of awk.double echo doc cat >doc <<'END of doc' This is a document about Awk Awk is a Pattern scanning and Processing Language Awk is another scripting language Awk is named after Aho, Weinberger and Kerningham Developed around 1978. END of doc echo foo cat >foo <<'END of foo' this is a sample sample document It will try not to to repeat words too often. This is a line that does not contain repeated adjacent words END of foo echo list cat >list <<'END of list' Susie 200 John 100 Susie 400 John 100 Marie 600 John 50 Mary 300 END of list echo mail cat >mail <<'END of mail' Department of Computer Science Courant Institute New York University DEPARTMENTAL COLLOQUIUM Josh Fisher Hewlett-Packard Laboratories Cambridge, MA Courant Heritage in the HP & Intel Developed IA-64, and Some Future Trends in Instruction-Level Parallel Architectures and Compiling. It is not generally known that a significant portion of the jointly developed HP & Intel explicitly parallel architecture had its roots at the Courant Institute. These roots are in the origin at Courant of "region scheduling"--the idea that compilers should do their scheduling phase across large regions of code, not basic blocks. After its origin within Ralph Grishman's PUMA project, region scheduling had a big influence on the practical exploitation of VLIWs in the 1980s, then on a project started at HP Labs 10 years ago and, in turn, on the IA-64. In this talk, I'll first briefly review the genesis of region scheduling, and the odd perspective from which it was invented at Courant. Although it's now over 20 years old, considerably enhanced, and universally used to generate code for CPUs with a lot of ILP, far too little is known about it. I'll discuss some of the major open questions and research which attempts to answer those questions (and the lack thereof). I'll then discuss some future trends, including region scheduling at run time, which I believe will have a big effect on both general-purpose and embedded architectures, and on architectural variety. Friday, February 12, 1999 11:30am - 12:30pm Warren Weaver Hall, Room 1302 251 Mercer Street New York, NY 10012-1185 Host: Krishna Palem, (palem@cs.nyu.edu) (212) 998-3512 Directions: http://www.cs.nyu.edu/directions/new_wsq-campus.html Colloquium Information: http://www.cs.nyu.edu/colloquium/calendar2.html END of mail echo mailer.awk cat >mailer.awk <<'END of mailer.awk' cat $1 | awk 'BEGIN {headermode=1} { if (headermode == 1 && $1 == "Status:" ) { headermode = 0 } else if (headermode == 1 && $1 == "X-Status:" ) { headermode = 0 } else if (headermode == 0 && NF > 0 && $1 != "X-Status:") { print $0 } }' > tmp; mv tmp $1; head $1 END of mailer.awk echo new cat >new <<'END of new' this is a sample sample document one one It will try not to to repeat words too often. This is a line that does not contain repeated adjacent words words END of new echo prog cat >prog <<'END of prog' $1 != prev {print; prev = $1} END of prog echo sum.awk cat >sum.awk <<'END of sum.awk' {sum[$1] +=$2} END { for (name in sum) print name, sum[name]} END of sum.awk