Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!apple!sun-barr!decwrl!sgi!archer@elysium.corp.sgi.com From: archer@elysium.corp.sgi.com (Archer Sully) Newsgroups: comp.sys.sgi Subject: Re: rand in awk Message-ID: <43482@sgi.sgi.com> Date: 24 Oct 89 22:06:46 GMT References: <63*finnd@vax.runit.unit.uninett> Sender: archer@elysium.corp.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 26 In article <63*finnd@vax.runit.unit.uninett>, finnd%vax.runit.unit.uninett@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@sgi.com) "life is short, filled with stuff" -- Lux Interior