Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2003 19:55:36 +0900
From:      Rob Lahaye <lahaye@snu.ac.kr>
To:        Charles Howse <chowse@charter.net>, "'Gil Agno Virtucio'" <gihl@nesic.com.ph>, freebsd-questions@FreeBSD.ORG
Subject:   Re: randomize execution the a script?
Message-ID:  <3F698F28.7080902@snu.ac.kr>
In-Reply-To: <001701c37dd2$9467f170$04fea8c0@moe>
References:  <001701c37dd2$9467f170$04fea8c0@moe>

next in thread | previous in thread | raw e-mail | index | archive | help

Charles Howse wrote:
> 
> I don't happen to have random installed on my system, however jot is

It's in /usr/games/random of FreeBSD 4.8.

> Won't randomNumber=$? Just return 0 if the previous command completes
> successfully?
> Shouldn't it be:
> randomNumber=`random -e 60`

No. In 'man 6 random', it says:

     random [-er] [-f filename] [denominator]

     -e      If the -e option is specified, random does not read or write any-
             thing, and simply exits with a random exit value of 0 to
             denominator - 1, inclusive.

So you must capture its exit value for the random number :).

R.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F698F28.7080902>