From owner-freebsd-questions@FreeBSD.ORG Thu Sep 18 03:55:38 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51B9716A4B3 for ; Thu, 18 Sep 2003 03:55:38 -0700 (PDT) Received: from spam1.snu.ac.kr (spam2.snu.ac.kr [147.46.10.68]) by mx1.FreeBSD.org (Postfix) with SMTP id 0FCDF43FDD for ; Thu, 18 Sep 2003 03:55:37 -0700 (PDT) (envelope-from lahaye@snu.ac.kr) Received: (snipe 29766 invoked by alias); 18 Sep 2003 11:24:40 -0000 Received: from lahaye@snu.ac.kr with Spamsniper2.0 (Processed in 0.050435 secs); Received: from unknown (HELO sis1.snu.ac.kr) (147.46.10.36) by 0 with SMTP; 18 Sep 2003 11:24:40 -0000 X-RCPTTO: freebsd-questions@FreeBSD.ORG,gihl@nesic.com.ph,chowse@charter.net, Received: from snu.ac.kr ([147.46.44.183]) by sis1.snu.ac.kr (8.12.9/8.12.9) with ESMTP id h8IAsg9H298070; Thu, 18 Sep 2003 19:54:42 +0900 Message-ID: <3F698F28.7080902@snu.ac.kr> Date: Thu, 18 Sep 2003 19:55:36 +0900 From: Rob Lahaye Organization: Seoul National University - South Korea User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20030726 X-Accept-Language: en-us, ko-kr MIME-Version: 1.0 To: Charles Howse , "'Gil Agno Virtucio'" , freebsd-questions@FreeBSD.ORG References: <001701c37dd2$9467f170$04fea8c0@moe> In-Reply-To: <001701c37dd2$9467f170$04fea8c0@moe> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: randomize execution the a script? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2003 10:55:38 -0000 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.