rand in awk

Archer Sully archer at elysium.corp.sgi.com
Wed Oct 25 08:06:46 AEST 1989


In article <63*finnd at vax.runit.unit.uninett>, finnd%vax.runit.unit.uninett at NAC.NO (Finn Drablos) writes:
> I try to install an utility under Irix 3.1D, using awk. However, I get
> problems with rand() and srand(). For example
> 
>   $awk '{ print rand() }'
>   awk: syntax error near line 1
>   awk: illegal statement near line 1
>   $awk '{ print rand(2.0) }'
> 
>   2
> 
>   2
> 
> Not very useful, really. Am I doing something wrong, or is this a bug ?
> Is there anything I can do to make it work (except for implementing my
> own random number generator) ?

awk is still the old awk.  Try using 'nawk' instead.  It is the new awk
that is described in 'The AWK programming Language'.


--
Archer Sully (archer at sgi.com)

"life is short, filled with stuff"
		-- Lux Interior



More information about the Comp.sys.sgi mailing list