Re: Awk Question - Again

From: Christoph Gysin (fr33z3_at_gmx.ch)
Date: 10/29/04


Date: Fri, 29 Oct 2004 16:54:12 +0200

Arthur wrote:
> name=`echo $label1 | awk '{print substr($label1,1,index($label1,"
> "))}'`
>
> I am receiving this error:
>
> awk: Field $() is not correct.
> The input line number is 1.
> The source line number is 1.
>
> My input looks like this:
> JOHN_DOE 255
> JANE_DOE 160

How about:
name=`echo $label1 | awk '{print($1)}'`

Christoph