From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 29 22:09:56 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A03716A420; Tue, 29 Nov 2005 22:09:56 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97A3A43D6E; Tue, 29 Nov 2005 22:09:55 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id jATM9sb6052423; Tue, 29 Nov 2005 14:09:54 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id jATM9sOI052422; Tue, 29 Nov 2005 14:09:54 -0800 (PST) (envelope-from jmg) Date: Tue, 29 Nov 2005 14:09:54 -0800 From: John-Mark Gurney To: Jayesh Jayan Message-ID: <20051129220954.GN885@funkthat.com> Mail-Followup-To: Jayesh Jayan , freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org References: <20051129212732.GL885@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org Subject: Re: Bash scripting -- Usage of arrays X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2005 22:09:56 -0000 Jayesh Jayan wrote this message on Wed, Nov 30, 2005 at 03:19 +0530: > I already have bash installed from ports. It is bash 2.05b. But below you were running sh, and not bash... if you do sh array.sh, it will not reinterpet the #!/bin/bash line, and re-exec it with the program in part because /bin/bash doesn't exist on the system, as bash is installed in /usr/local/bin/bash... Please try with: bash array.sh instead, and see if that works.. > On 11/30/05, John-Mark Gurney wrote: > > > > Jayesh Jayan wrote this message on Wed, Nov 30, 2005 at 02:39 +0530: > > > Below is the output. > > > > > > # sh array.sh > > > > Install the bash port (as root: pkg_add -r bas), and then try again > > using bash... > > > > FreeBSD doesn't have bash installed by default (and hence, /bin/sh is > > not bash like it is usually on Linux), and our sh doesn't have that > > feature... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."