Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: Replies to 'Using pipes within awk programs' Message-ID: <39804@sun.uucp> Date: 23 Jan 88 07:36:22 GMT References: <515@root44.co.uk> <519@root44.co.uk> Sender: news@sun.uucp Lines: 33 Keywords: awk, pipe > Yes, the feature is there on *almost* all implementations (a few people gave > examples of specific systems on which it doesn't work). However, there is > a bug on many versions (mostly sysV & derivatives): And 4.2BSD as well. > This feature is documented in a new book "The Awk Programming Language" > by Aho, Weinberger and Kernighan. Their book covers the old (V7) awk and > the new one with Sys 5.3 that has functions calls and other goodies. The > first example you give DOES NOT work with 4.2 BSD awk or with the awk > supplied in version 3.0 SunOS (they both silently do nothing), though awk > in 3.2 SunOS does work the way you expect. This leads me to conclude > (without checking our sources) that the 4.2 BSD and 3.0 SunOS awk is > essentially V7 awk which does not support pipes. The 3.0 SunOS "awk" is essentially the 4.2BSD "awk" with a bug that caused some problems with fields fixed. This bug was introduced in the process of fixing NULL pointer dereferencing bugs, so it's probably not in versions not derived from the 4.2 one. The bug is fixed in 4.3BSD. The 3.2 "awk" is the S5R2 "awk", with the 4.3BSD fix to the pipe problem added. It is not the new S5R3 "awk". There were actually two V7 "awk"s: the one that came on the original V7 tape and one that came on a "V7 addendum" tape. The 4.2BSD (and 4.1BSD) "awk" is derived from the "V7 addendum" tape version; it included code to handle pipes, but did not include the fix from 4.3BSD. The main difference between the "V7 addendum" "awk" and the S5R2 "awk" is that the latter is considerably faster; a number of things were changed that probably account for this (for one thing, the structure-valued functions and function arguments were nuked). Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com