awk syntax error

July 6, 2009 at 13:54:30
Specs: AIX
I have the following awk command
It gives a syntax error near "if" statement below.

Based on the value of s, if it greater or equal to 0, the record need to be replaced with '$1.$2.$3.$4," 0.0.0."s'

Any comments ?

awk -F"." '{s=$8-$4 if (s >= 0) print $1.$2.$3.$4," 0.0.0."s }' g1 >g2

See More: awk syntax error

Report •

July 6, 2009 at 19:40:31
if you want to cram them together into one line, use appropriate ";" to signify each individual awk statement.

GNU win32 packages | Gawk

Report •

July 7, 2009 at 07:08:55
Thank you. It worked.

Report •

Related Solutions

Ask Question