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 Chriss Miller 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
Joined
Nov 12, 2002
Messages
4
Location
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


 
Use 'nawk' on Solaris, not 'awk'
 

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