2.8BSD awk question: Oooh, I get it!

Jeffrey W Percival jwp at uwmacc.UUCP
Thu Nov 27 06:41:58 AEST 1986


I get it!  I answered my own question.

In awk, only fields are referred to with a leading $...
$0 is the whole line, $1 is field 1, and so on.
My variable was called "header", so the correct statement is

	print header

not

	print $header

I guess $header was being evaluated as $0, so the observed output makes sense.

I guess I get the Emily Litella award for today...  Never mind!
-- 
	Jeff Percival ...!uwvax!uwmacc!sal70!jwp or ...!uwmacc!jwp



More information about the Comp.unix.questions mailing list