Path: news1.ucsd.edu!ihnp4.ucsd.edu!munnari.OZ.AU!news.ecn.uoknor.edu!news.eng.convex.com!newshost.convex.com!newsgate.duke.edu!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!scanner.worldgate.com!alpha3!awkfaq
Newsgroups: comp.lang.awk,comp.answers,news.answers
Followup-To: comp.lang.awk
From: awkfaq@locutus.ofB.ORG
Reply-To: awkfaq@locutus.ofB.ORG
Subject: comp.lang.awk FAQ
Summary: FAQ (Frequently Asked Questions) about the AWK programming language
Message-ID: <19960910.awkfaq.01@locutus.ofB.ORG>
Supersedes: <19960826.awkfaq.01@locutus.ofB.ORG>
Date: 10 Sep 1996 02:00:00 -0600
Expires: 11 Oct 1996 12:00:00 GMT
Organization: Private System, Edmonton, AB, Canada
Approved: news-answers-request@MIT.EDU
X-Posted-By: trivdb
Lines: 384
Xref: news1.ucsd.edu comp.lang.awk:2124 comp.answers:16235 news.answers:64981

Archive-name: computer-lang/awk-faq
Author: awkfaq@locutus.ofB.ORG (Russell Schulz)
Comp-lang-awk-archive-name: faq
Posting-Frequency: biweekly
Last-modified: 1996-09-08

Frequently Asked Questions == FAQ


========================================================================

Contents:

   1. Disclaimer
   2. Can you answer my awk question?
   3. How can I add a FAQ and its answer to the FAQ list?
   4. What is AWK?
   5. What well-maintained awk-compatible languages are there?
   6. Where can I buy AWK?
   7. Where can I get AWK for free?  For what platforms?
   8. Why would anyone still use AWK instead of Perl?
   9. What's wrong with gawk on Digital's OSF/1?
  10. How do I report a bug in gawk?
  11. How can I learn awk?
  12. Miscellaneous
  99. Credits


========================================================================

1. Disclaimer

Read at your own risk.  The current, previous, or original authors
make no claim as to fitness for any purpose or absence of any errors,
and offer no warranty.  Do not eat.


========================================================================

2. Can you answer my awk question?

Probably not.  Please don't mail it to me.

Read the FAQ, and the materials pointed to by it, and if you can't find
an answer there, by all means post to the newsgroup.

A FAQ list is intended to reduce traffic on a newsgroup, not eliminate it.


========================================================================

3. How can I add a FAQ and its answer to the FAQ list?

Mail BOTH of them to me.  Then I can add them to the FAQ and it should
help people who have that same question later, as well as everyone who
reads the group, because they won't see it asked and answered so often.

I do not work on this FAQ every day, but I will try to get updates
incorporated in a timely manner.

  
========================================================================

4. What is AWK?

AWK is a programming language, named after its three original authors:

  Alfred V. Aho
  Brian W. Kernighan
  Peter J. Weinberger

they write:

``
  Awk is a convenient and expressive programming language that can be
  applied to a wide variety of computing and data-manipulation tasks.
''


========================================================================

5. What well-maintained awk-compatible languages are there?

  5.1 nawk
    AT&T's `new awk' -- probably nobody uses the `old awk' anymore.
    interpreter

  5.2 gawk
    from the GNU project
    interpreter

  5.3 mawk
    from Michael Brennan <mailto:brennan@whidbey.com>
    interpreter

  5.4 tawk
    from Thompson Automation
    interpreter
    compiler

  5.5 mksawk [is this the same as any of the others?]
    interpreter
    compiler
    from Mortice Kern Systems

  5.6 awkcc
    translator to C

  5.7 awk2c
    translator to C

  5.8 a2p
    translator to Perl
    comes with Perl


========================================================================

6. Where can I buy AWK?

6.1 AT&T (awk, awkcc)

  _The AWK Programming Language_ says:
    phone
      +1 201 522 6900 [is this number still valid?]
    and login as `guest'.

  <http://www.unipress.com/att/new/awk.html>
  <http://www.unipress.com/att/new/awkcc.html>
  <http://www.att.com/ssg/new/awk.html>
  <http://www.att.com/ssg/new/awkcc.html>

6.2 Thompson Automation (tawk)

  <http://www.tasoft.com/~thompson/tawk.html>

  <http://www.teleport.com/~thompson/>

  Thompson Automation Software
  5616 SW Jefferson
  Portland, OR   97221
  USA

  North America: 800-944-0139
  Phone: +1 503 224 1639
  Fax: +1 503 224 3230

6.3 MKS (awk, can generate standalone interpreted .exe)

  <http://www.mks.ca/solution/tk/>

  Mortice Kern Systems
  185 Columbia Street W
  Waterloo, ON
  N2L 5Z5
  Canada

  North America: 800-265-2797
  Phone: +1 519 884 2251
  Fax: +1 519 884 8861


========================================================================

7. Where can I get AWK for free?  For what platforms?

  7.0 meta-answer
    Obtaining Awk and Perl
    <http://uts.cc.utexas.edu/~churchh/awk-perl.html>

  7.1 original awk
    <ftp://netlib.att.com/netlib/research/awk.bundle.Z>

  7.2 the one true awk
    <http://plan9.att.com/who/bwk/awk.sh>

  7.3 gawk
    ftp.gnu.ai.mit.edu/pub/gnu/gawk*
    <ftp://ftp.gnu.ai.mit.edu/pub/gnu/>
    e.g.,
      <ftp://ftp.gnu.ai.mit.edu/pub/gnu/gawk-3.0.0.tar.gz>

      7.3.1 gawk precompiled for MS-DOS or OS/2

        32bit DOS (djgpp) and 16bit OS/2 and DOS (msc) versions are
        part of the GNUish project:

        <http://www.coast.net/SimTel/gnu/gnuish.html>      (US)
        <http://www.simtel.net/simtel.net/>                (US)
        <ftp://ftp.simtel.net/pub/simtelnet/gnu/gnuish/>
        <http://www.leo.org/pub/comp/platforms/pc/gnuish/> (Germany)
        <http://wuarchive.wustl.edu/systems/msdos/gnuish/> (US)

        32bit OS/2 and DOS (emx) versions:

        <http://www.leo.org/pub/comp/os/os2/gnu/script/gnuawk.zip> (Germany)
        <ftp://ftp-os2.cdrom.com/pub/os2/lang/gnuawk.zip>          (US)

  7.4 gawk.dll
    <http://www.muc.de/~walkerj/>
      Gawk 2.15.2 plus extensions
      + Read/Write functions for INI files
      + Read-only functions for DBF files

  7.5 mawk
    <ftp://ftp.whidbey.net/pub/brennan/>
    <ftp://oxy.edu/public/>
    e.g.,
      <ftp://oxy.edu/public/mawk1.2.2.tar.gz>
      <ftp://oxy.edu/public/mawk1.3beta.tar.gz>

  7.6 awk2c
    <ftp://sunsite.unc.edu/pub/Linux/utils/text/awk2c050.tgz>

  7.7 awkcc [binary distribution only?!  for what platform?  DOS?]
    <http://www.mks.ca/files/support/unsupported/awkcc.tgz>
    binary file, not marked as such -- your browser may fumble it.
    `lynx -source http://... > awkcc.tgz' works

  7.8 various old binary-only distributions for MSDOS
    ftp.coast.net:/pub/SimTel/msdos/awk/
    <http://www.coast.net/SimTel/msdos/awk.html>


========================================================================

8. Why would anyone still use AWK instead of Perl?

  a valid question, since AWK is a subset of Perl.  however:

  - awk is simpler
  - you may already know awk well enough
  - you may already have awk installed
  - awk can be smaller, thus much quicker to execute for small programs
  - awk variables don't have `$' in front of them :-)


========================================================================

9. What's wrong with gawk on Digital's OSF/1?

The version of gawk shipped with OSF/1 is very old, based on gawk 2.14.
Get the current version from a GNU mirror near you, and if you still
have a problem, report it as per the directions in the gawk documentation.


========================================================================

10. How do I report a bug in gawk?

This is described in great detail in the gawk documentation. In brief,

   1. Make sure what you've discovered is really a bug by checking
      the documentation and, if possible, comparing with nawk and mawk.

   2. Cut down the program and data to as small as possible a test
      case that will illustrate the bug.

   3. Send mail to <mailto:bug-gnu-utils@prep.ai.mit.edu>, with a carbon
      copy to <mailto:arnold@gnu.ai.mit.edu>.

   4. Do not just post in comp.lang.awk; Arnold's readership there is
      sporadic.


========================================================================

11. How can I learn awk?

  The commercial vendors of DOS versions (MKS and Thompson) each have
  their own well written books with examples.  [available separately?]

  Book:

      "The AWK Programming Language," by Aho, Kernighan and Weinberger,
      who invented the language. Published by Addison-Wesley. Lots of
      good material in not a lot of space.  A little out of date
      w.r.t. POSIX awk.

      ISBN 0-201-07981-X

  Book:

      "Effective AWK Programming" by Arnold Robbins.  Published by
      SSC (+1 206-FOR-UNIX, <http://www.ssc.com>, <mailto:sales@ssc.com>).
      Also published by the FSF as "The GNU AWK User's Guide"; Texinfo
      source is included with the gawk distribution, so you can also
      print this yourself.

      ISBN 0-916151-88-3

      Russell recommends buying the book instead of printing it all
      out, for three reasons:

        1. it's probably cheaper
        2. some money goes back to help further development [right?]
        3. it helps convince publishers that we _like_ having full
           documentation available on-line (e.g., for searching), but
           will still pay for a compact, bound copy

      information, including an errata list, is on the web site.

      <http://www.ssc.com/ssc/eap/>

  Book:

      "Sed & Awk", by Dale Dougherty, published by O'Reilly and
      associates.  A nice introduction to sed and awk, showing how
      they relate to each other. However, the first edition is full
      of typos and out-and-out mistakes. A second edition is supposedly
      in the works.

      [does anyone have an errata list?]

      <http://www.ora.com/catalog/sed/noframes.html>
      <http://www.ora.com/catalog/covers/sedawk-t.gif>

      ISBN 0-937175-59-5

  Web Site:

      <http://www.cit.ac.nz/smac/os202/default.htm>

      Unix and AWK courseware

  Web Site:

      <http://www.cs.hmc.edu/FAQ/qref/awk.html>

      Getting started with AWK

  Web Site:

      <http://www.uga.edu/~ucns/sss/unix/awk.html>

      Awk introduction

  Web Site:

      <http://www.mbnet.mb.ca/~natewild/awk/awk.html>

      Information about Tawk; AWK sample source code

  Web Site:

      <http://www.ee.ic.ac.uk/course/advanced/awk/awk.html>

      Awk course


========================================================================

12. Miscellaneous


========================================================================

99. Credits

I expect most of the information in this FAQ to be supplied by people
other than myself -- it's just going to work better that way.  The
newsgroup readers have a LOT more awk experience than I ever will
(unless I multiply myself by a few thousand, which is not legal with
today's tax laws).


These people have contributed to the well-being of the FAQ:

  arnold@gnu.ai.mit.edu (Arnold D. Robbins)
  100335.120@CompuServe.COM (James G. Walker)
  jland@worldnet.att.net (Jim Land)
  yuli.barcohen@telrad.co.il (Yuli Barcohen)
  johnd@mozart.inet.co.th (John DeHaven)
  amnonc@mercury.co.il (Amnon Cohen)
  saguyami@post.tau.ac.il (Shay)
  hankedr@mail.auburn.edu (Darrel Hankerson)
  mark@ispc001.demon.co.uk (Mark Katz)
  brennan@whidbey.com (Michael D. Brennan)

Thanks.

========================================================================

thus endeth the awk FAQ.