Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help please! 'while' won't work!

Status
Not open for further replies.

sixpot

IS-IT--Management
Nov 12, 2002
4
GB
Hi All

I'm trying to run the following awk script on Solaris 8. I've used the same code successfully many times on AIX but here it's just erroring with...

awk: syntax error near line 8
awk: illegal statement near line 8

...where line 8 is the while statement.


BEGIN {

INFILE="swift.txt"

{
while (( getline < INFILE ) > 0)
if (length ($0) > 0)
MERVREC[++NOMERV] = $0
close (INFILE)
}

# end of begin
}

Does anybody have any ideas as to why this won't work?

Many thanks
Luke


 

You need to use nawk instead of awk on Solaris

CaKiwi

&quot;I love mankind, it's people I can't stand&quot; - Linus Van Pelt
 
You're a star! Many thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top