On 7 mar, 01:53, Lorenz <loren...@[EMAIL PROTECTED]
> wrote:
> >ls -ltr|awk 'split($8,a,":");t=3Dt+a[2] END {print t,NR ,t/NR }'
>
> what you have here is three rules whereof two have no explicit action.
> That is equivalent to:
>
> =A0 =A0 =A0 =A0 ls -ltr|awk 'split($8,a,":") {print} \
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
=A0t=3Dt+a[2] =
{print} \
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0END
{print =
t,NR ,t/NR }'
> --
>
> Lorenz
Thanks Patrick,Lorenz
Patrick "the braces turn those two patterns into a single action which
will
be evaluated for each input record. "
but then the split and the sum will evaluate to true. it will not
produce output but calculate twice.??
ls -ltr|awk '{split($8,a,":");t=3Dt+a[2]} END {print t,NR ,t/NR }'
193 14 13.7857


|