Jim Meyering writes:
>
> Dennis Clarke wrote:
> > FAIL: cp/sparse-fiemap
> ...
> > + awk '/^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END {print ""}'
> > awk: cmd. line:1: /^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END
> > {print ""}
> > awk: cmd. line:1: ^ syntax error
> > + sed 's/ [a-z,][a-z,]*$//' ff1
>
> Thank you for the report.
> What awk program and version are you using?
> I.e., awk --version might help.
> Also, what distribution are you using?
I can't figure out what version he's using, but Mr. Kernighan's awk doesn't
like that syntax either. Notice that if you changed the '<' to a '>' it would
be an output redirection for the printf. Using the '<' as a comparison
operator in the same position is awfully fragile.
Parenthesizing the ternary expression makes it happy again.
>
> BTW, that syntax works for me using the latest gawk with or without -W compat,
> and with the mawk and nawk programs from debian unstable.
apt-get install original-awk
--
Alan Curry