Awk.Info

"Cause a little auk awk
goes a long way."

About awk.info
 »  table of contents
 »  featured topics
 »  page tags


About Awk
 »  advocacy
 »  learning
 »  history
 »  Wikipedia entry
 »  mascot
Implementations
 »  Awk (rarely used)
 »  Nawk (the-one-true, old)
 »  Gawk (widely used)
 »  Mawk
 »  Xgawk (gawk + xml + ...)
 »  Spawk (SQL + awk)
 »  Jawk (Awk in Java JVM)
 »  QTawk (extensions to gawk)
 »  Runawk (a runtime tool)
 »  platform support
Coding
 »  one-liners
 »  ten-liners
 »  tips
 »  the Awk 100
Community
 »  read our blog
 »  read/write the awk wiki
 »  discussion news group

Libraries
 »  Gawk
 »  Xgawk
 »  the Lawker library
Online doc
 »  reference card
 »  cheat sheet
 »  manual pages
 »  FAQ

Reading
 »  articles
 »  books:

WHAT'S NEW?

Mar 01: Michael Sanders demos an X-windows GUI for AWK.

Mar 01: Awk100#24: A. Lahm and E. de Rinaldis' patent search, in AWK

Feb 28: Tim Menzies asks this community to write an AWK cookbook.

Feb 28: Arnold Robbins announces a new debugger for GAWK.

Feb 28: Awk100#23: Premysl Janouch offers a IRC bot, In AWK

Feb 28: Updated: the AWK FAQ

Feb 28: Tim Menzies offers a tiny content management system, in Awk.

Jan 31: Comment system added to awk.info. For example, see discussion bottom of ?keys2awk

Jan 31: Martin Cohen shows that Gawk can handle massively long strings (300 million characters).

Jan 31: The AWK FAQ is being updated. For comments/ corrections/ extensions, please mail tim@menzies.us

Jan 31: Martin Cohen finds Awk on the Android platform.

Jan 31: Aleksey Cheusov released a new version of runawk.

Jan 31: Hirofumi Saito contributes a candidate Awk mascot.

Jan 31: Michael Sanders shows how to quickly build an AWK GUI for windows.

Jan 31: Hyung-Hwan Chung offers QSE, an embeddable Awk Interpreter.

[More ...]

Bookmark and Share

categories: Sigs,Tools,Apr,2009,Anon

Hiding Email Address

Contents

Synopsis

Download

Description

Code

Author

Synopsis

gawk -f cryptosig.awk tim@menzies.us

Download

Download from LAWKER.

Description

Generates a one-line Awk program that can print your email, from a seemingly jumbled string. This program can then become your email sig and only the Awk cognoscente can generate a reply.

Example

% gawk -f cryptosig.awk tim@menzies.us
BEGIN{a="7059631863556476595569007169";while(a){printf("%c",46+substr(a,1,2));a=substr(a,3)}}

This can be tested as follows:

echo 'BEGIN{a="7059631863556476595569007169";while(a){printf("%c",46+substr(a,1,2));a=substr(a,3)}}' | gawk -f -

or

gawk -f crypotsig.awk tim@menzies.us | gawk -f -

both of which should print "tim@menzies.us".

Code

BEGIN {
  for (i=0; i<=255; i++) {           # build table of char=value pairs
    ord_arr[sprintf("%c",i)] = i     # character = ordinal value
  }
  for (i=1; i<=ARGC-1; i++) {
    str = ""
    for (j=1; j<=length(ARGV[i]); j++) {
      str = sprintf("%s%02d",str,ord_arr[substr(ARGV[i],j,1)]-46)
    }
    printf("BEGIN{a=\"%s\";while(a){printf(\"%%c\",46+substr(a,1,2));a=substr(a,3)}}\n",str)
  }
  exit(0)
}

Author

BEGIN{a="535170696159626207061118755158656500536563";
      while(a){
          printf("%c",46+substr(a,1,2));a=substr(a,3)};
      print("")
}

categories: Sigs,Tools,Apr,2009,Timm

Random Signatures

Contents

Synopsis

chmod +x sigs; ./sigs

Download

Download from LAWKER.

Description

Generates random signtures. Signatures and generation code included in same file so installation is just a matter of calling one file.

Most of the file is a large "here" document. Paragraph 1 of that document is always added to the signatures, followed one of the folowing paragraphs, selected at radonom.

To add to the signtures, include them in the here document, with one preceeding blank line.

Code

Pick1

pick1() {
    gawk 'BEGIN { srand(); RS=""    }
          NR==1 { print $0 "\n"     }
          NR>1  { Recs[rand()] = $0 }
          END   { for ( R in Recs ) {print Recs[R]; exit}}
        ' $1
}

The Signatures

cat << SoMEI_mpOSSIblE_sYMBOl | pick1
tim.menzies {
  title:   dr (Ph.D.) and associate professor;
  align:   csee, west virginia university;
  cell:   esb 841A; 
  url:   http://menzies.us;
  fyi:   unless marked "URGENT", i usually won't get 2 your email b4 5pm; 
}

Doing a job RIGHT the first time gets the job done. Doing the job WRONG
fourteen times gives you job security.

Rome did not create a great empire by having meetings, they did it by
killing all those who opposed them.

INDECISION is the key to FLEXIBILITY.

"When a subject becomes totally obsolete we make it a required
course."  Peter Drucker

I saw two shooting stars last night but they were only satellites .
Its wrong to wish on space hardware. I wish, I wish, I wish you cared.
-- Billy Bragg

Then, in 1995, came the most amazing event in the
history of programming languages: the introduction
of Java.  -- Programming Languages: Principles and Practice

Suburbia is where the developer bulldozes out the trees, then names
the streets after them. --Bill Vaughan

Instant gratification takes too long.
-- Carrie Fisher

Complexity is easy. Simplicity is hard.
--Unknown

Author

Tim Menzies

blog comments powered by Disqus