From owner-freebsd-questions@FreeBSD.ORG Thu Oct 7 16:15:27 2004 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 A03BD16A4D9 for ; Thu, 7 Oct 2004 16:15:27 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4327B43D41 for ; Thu, 7 Oct 2004 16:15:13 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i97GExgL008499; Thu, 7 Oct 2004 19:15:02 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i97GEve7008940; Thu, 7 Oct 2004 19:14:57 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost)i97GEvL0008939; Thu, 7 Oct 2004 19:14:57 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 7 Oct 2004 19:14:57 +0300 From: Giorgos Keramidas To: Andrew Moran Message-ID: <20041007161457.GA8869@orion.daedalusnetworks.priv> References: <22ECDF671FCD564398087D64CFCF46BD056E08D4@EXCHANGE.campus.stcloudstate.edu> <35A62D03-187A-11D9-8881-000D93B1D960@forsythia.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35A62D03-187A-11D9-8881-000D93B1D960@forsythia.net> cc: "Pratt, Benjamin E." cc: freebsd-questions@freebsd.org Subject: Re: Shell script error 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, 07 Oct 2004 16:15:27 -0000 On 2004-10-07 09:01, Andrew Moran wrote: >On Oct 7, 2004, at 7:07 AM, Pratt, Benjamin E. wrote: >> Hello, it's me again. This time I'm trying to do some shell scripting >> but I'm running into a problem with a randomization script that I found >> on the web. The script I'm trying to run can be found at: >> http://www.bsdbooks.net/shells/scripting/randomvar.html#PICKCARD. >> >> Everything runs fine on different Linux systems that I've used (Red >> Hat 9, Knoppix-STD, PHLAK) but when I run the script on FreeBSD or >> OpenBSD I get errors. I'm mainly running FreeBSD 5.3-BETA right now >> with /shells/bash2 installed so that's where I'd really like to get >> it running. >> >> I did change the first line to point to /usr/local/bin/bash but that >> didn't make any difference. >> >> If anyone knows why this won't run, or if anyone has another example of >> getting a random character (I'd eventually like to generate a random >> hexadecimal character) I'd love to hear from you. > > That script works fine for me on my box and I'm also running FreeBSD > 5.3-BETA with bash2. > > What kind of error are you getting? What is the output of "bash -x > " (filling in the script name of course). I've run this successfully on FreeBSD 6.0-CURRENT too. Some of the test runs are shown below: $ bash card.sh 9 of Clubs $ bash card.bash 6 of Spades $ bash card.bash King of Spades - Giorgos