Possible bug in awk?

Saul jaffe at topaz.ARPA
Tue Apr 9 04:54:49 AEST 1985


I have been trying to do some stuff with awk that I saw in an
example in one of the Unix books and it doesn't work as I thought.

It seems to me that the line:

echo "This is a test" | awk {$1 = "Foo"; print}

should print out "Foo is a test" but all I get when I try it is the
original line.

Is this a bug in awk?  If I specify that I want $1, $2 etc printed
I get the correct values.

If this is a bug does anyone know of a fix???
-- 
Saul Jaffe
Systems Programmer
Rutgers University
ARPA: Jaffe at Rutgers
UUCP: ...{harvard,seismo,ut-sally,ihnp4!packard}!topaz!jaffe



More information about the Comp.bugs.4bsd.ucb-fixes mailing list